browser_run_code
Execute JavaScript functions in a browser tab using Playwright for web automation tasks.
Instructions
Run a Playwright JavaScript function against the specified tab.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | A JavaScript function body or arrow function. It will receive page as the first argument. | |
| tab_id | No | Stable tab id from browser_tabs list; preferred when multiple agents run in parallel. Mutually exclusive with tab_index. | |
| tab_index | No | Tab index from browser_tabs list. If omitted, uses the lowest-index tab. Mutually exclusive with tab_id. |