docs: add sandbox variables explanation to Examples

This commit is contained in:
Tommy D. Rossi
2026-01-24 15:23:31 +01:00
parent ab113914cd
commit 157c3a62d6
+2
View File
@@ -64,6 +64,8 @@ console.log({ title, url: page.url() });
## Examples
Variables in scope: `page`, `context`, `state` (persists between calls), `require`, and Node.js globals.
**Persist data in state:**
```bash
playwriter -e "state.users = await page.$$eval('.user', els => els.map(e => e.textContent))"