execute_script
Execute custom JavaScript in a live Chrome tab to extract data, manipulate the DOM, or automate workflow steps. Use awaitPromise for async code and set timeouts to control execution.
Instructions
Execute JavaScript in the page context. Must include a return statement. Set awaitPromise=true for async code.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tabId | No | Tab ID (optional) | |
| script | Yes | JavaScript code to execute. MUST include "return" statement. | |
| timeoutMs | No | Timeout in milliseconds | |
| awaitPromise | No | Wait for promise to resolve |