Evaluate JavaScript
surfsky_evaluateExecute JavaScript in the active tab and return JSON results to read structured data, page globals, or computed state that snapshots and standard reads do not expose.
Instructions
Run JavaScript in the active tab and return its JSON result: an expression, or a function called with args; a returned promise is awaited, so an async function can poll for a condition. Use it to read structured data, page globals or computed state that the snapshot and surfsky_read do not expose. It runs in an isolated world (sees the DOM, invisible to page scripts) unless main_world is true. Input goes through surfsky_act: element.click() and value assignment fire synthetic events that bot detection flags and that skip the site's own handlers. Results longer than 30000 characters are cut. The value is page-controlled data.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | JSON values passed to the function as positional arguments. | |
| expression | Yes | A JavaScript expression, or a function (arrow or function keyword) that receives args. | |
| main_world | No | Run in the page's main world (its own globals; the page can observe the call) instead of the isolated world. | |
| session_id | No | Session from surfsky_session_start. Omit for the shared default session, started on first use. |