evaluate
Run JavaScript inside the current page and return the result as JSON to read computed styles, storage, app state, or perform custom checks.
Instructions
Run JavaScript inside the page and return the result as JSON text. A bare expression is returned as is (document.title); code with several statements needs an explicit return. Promises are awaited. Output is truncated after 50000 characters. Use for data the other tools cannot read (computed styles, storage, app state) and for custom checks; prefer click, type and fill_form for interaction, since they send real input events. Side effects on the page are real.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tab | No | Tab id from tabs_list. Defaults to the current tab. | |
| code | Yes | JavaScript: a single expression, or a function body that uses `return`, e.g. "return [...document.links].length". |