execute_javascript
Execute arbitrary JavaScript in the page context to debug click failures, read shadow DOM content, dispatch custom events, or extract data from any DOM element.
Instructions
Execute arbitrary JavaScript in the page context and return the result.
Use this to debug click failures, read shadow DOM content, dispatch custom events, extract data, or perform any DOM operation not covered by other tools.
Args: session_id: Active session ID. script: JavaScript code to execute. The last expression is returned as the result. Scripts with explicit 'return' statements also work for backward compatibility. frame_context: Iframe selector path for execution context. Use 'main' or omit for top-level.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes | ||
| script | Yes | ||
| frame_context | No |