execute_js
Execute JavaScript code directly in browser pages to interact with elements, fill forms, or call functions for debugging and automation tasks.
Instructions
Execute JavaScript code in the page context. Returns the result of the expression. Useful for clicking buttons, filling forms, or calling page functions.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | JavaScript code to execute in page context | |
| targetIndex | No | Target index from list_targets | |
| port | No | Chrome CDP port |