Run JavaScript
browser_evaluateExecutes JavaScript expressions or functions on the current page, awaits promises, and returns JSON-compatible results for extracting dynamic data and checking page state.
Instructions
Run JavaScript on the current page, await promises, and return JSON text without a snapshot. Return JSON-compatible values; null/undefined become null. Script effects are not undone on failure. Cancellation stops waiting, but may not stop the script.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| arg | No | JSON object passed to the function; use properties for scalar or array values. | |
| expression | Yes | JavaScript expression or function to invoke. | |
| session_id | Yes | ID from `browser_open`; call `browser_fetch` first. | |
| isolated_context | No | False accesses the page's own JS variables; True uses a separate context with the same DOM. |