eval_js
Evaluate JavaScript in the live browser page via Playwright to extract dynamic DOM data and return JSON results. Use expressions or async functions for read-only page inspection.
Instructions
Evaluate JavaScript in the page via Playwright and return the result (JSON-projected; depth<=8, strings<=200k chars). Pass an expression or () => ... function source as code; top-level await is allowed. The sandbox is READ-ONLY and stripped: DOM reads, getComputedStyle, and scrolling work, but there is NO fetch/XMLHttpRequest/network, NO DOM mutation, no setInterval, and window only exposes an allowlist - use fetch_url or goto for network data. Warns if the tab is on a chrome-error:// page.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Expression or function source to evaluate in the page. | |
| tab_id | No | Optional tab id. |