browser_eval
Execute JavaScript code in the active page to inspect or modify its state, returning results as JSON-serializable values. Useful for dynamic testing and debugging.
Instructions
Evaluate a JavaScript expression in the active page (via CDP) and return its value. Runs in the page's main world and can mutate page state. Prefer browser_snapshot for reading structure and browser_click/type for interactions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| expression | Yes | A JavaScript expression evaluated in the page; its result is returned (JSON-serializable values). |