interceptor_browser_evaluate
Run a JavaScript file inside a page's isolated utility world and retrieve its return value. Enables invisible DOM reads and page-safe testing without altering page scripts.
Instructions
Execute a JS file in the page and return its result. Source is loaded from script_path (absolute path). The file body is wrapped in an arrow function receiving __args (so the file may return value; directly and access the optional args object). Runs in Playwright's isolated utility world (different window, same DOM). Reads are invisible to the page; mutations to shared prototypes/globals are observable by page scripts. For main-world patching use interceptor_browser_inject_init_script. Rate-limit before reCAPTCHA: each call emits CDP traffic that behavioural scorers count.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | Optional JSON-serialisable args object, available inside the script as `__args`. | |
| target_id | Yes | Target ID from interceptor_browser_launch | |
| script_path | Yes | Absolute path to a .js file. File body is the function body; use `return` to send a value back. | |
| value_max_chars | No | Max characters of the JSON-stringified return value (default: 20000, max 16000000). |