browser_select_frame
Execute JavaScript in a specific frame by index or return its text; locate the frame first with browser_list_frames.
Instructions
Execute JavaScript in a specific frame by frame index, through the Chrome debugger in that frame's own context - also a frame from another site. Use browser_list_frames first to find the right index. A returned promise is awaited; without code it returns the frame's text (first 5000 characters). The frame is identified by a one-time mark the extension puts in that frame's document, not by its address or position; if the mark is not found, nothing is run (error frame-not-reachable, and retry says whether calling again can help; a frame whose document is replaced while the call looks for it gives retry: true). The call answers within 29.5 s; if the time runs out before the code is sent, the answer is error call-timeout with sent:false (nothing ran).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | JavaScript EXPRESSION to evaluate in the frame (default: returns its text content) | |
| frame_index | Yes | Frame index from browser_list_frames (0 = main frame) |