Run JavaScript in the page
browser_evaluateEvaluate JavaScript expressions in browser page context and return results as JSON. Use it to read values hidden from the accessibility tree.
Instructions
Evaluate an expression in page context and return the result as JSON. The escape hatch for reading values the accessibility tree does not expose. Prefer browser_snapshot for reading structure and browser_click for interacting — synthetic events dispatched from here behave differently from real input and some sites notice.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | No | Evaluate against this element instead of the page. | |
| tabIndex | No | Act on this tab just for this call, without changing which tab is active. Defaults to the active tab. To switch tabs for good, use browser_tabs with action 'select'. | |
| profileId | Yes | Browser profile id, as passed to start_profile. | |
| expression | Yes | An expression (`document.title`) or a function (`() => { … }`). With `target`, the element is available as `el` — write `el.value` or `el => el.value`. |