evaluate
Run JavaScript in a Chrome tab to inspect or manipulate page elements, await promises, and return JSON results or page errors.
Instructions
Run JavaScript in the page. script is an expression or a function source; a function is called with the target element (or no argument). Promises are awaited. The result is JSON (truncated); DOM elements are rendered as snapshot lines with refs. Page exceptions are returned as errors.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tab | No | Tab id such as "t3"; default is the active tab | |
| script | Yes | ||
| target | No |