evaluate_script
Execute a JavaScript function in a Chrome page and return the result as JSON. Use it to extract data, inspect the DOM, or pass element UIDs as arguments.
Instructions
Evaluate a JavaScript function inside the page. Returns the result as JSON.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | Element uids from the latest snapshot, passed as function arguments. | |
| pageId | No | Targets a specific page by ID. Defaults to the selected page. | |
| filePath | No | ||
| function | Yes | A JavaScript function declaration. Example: () => document.title, or (el) => el.innerText | |
| dialogAction | No | "accept", "dismiss", or text for window.prompt. Defaults to accept. | |
| waitForStableDom | No |