execute_js
Execute JavaScript in a target tab and capture its return value, or run it in the current tab without output for fire-and-forget browser automation.
Instructions
Execute JavaScript in a page. If 'tab' is specified, uses CDP to run in that tab and return the result (no focus change). Without 'tab', uses IPC on the current tab (fire-and-forget, no return value).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tab | No | Tab to target by URL or title substring. Uses CDP — returns the result. | |
| code | Yes | JavaScript code to execute | |
| quiet | No | Suppress output in qutebrowser UI (IPC mode only) |