switchFrame
Direct browser automation into any iframe, including cross-origin frames, so subsequent commands act on that frame. Reset to the main frame with no arguments.
Instructions
Set the active frame so click/type/hover/analyzePage/find/executeScript/waitForElement run INSIDE it — required to automate cross-origin iframes (resolved via CDP, bypassing Same-Origin Policy). Call with no args to reset to the main frame. Auto-resets on navigateTo.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "switchFrame"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| frameUrl | No | Substring matched against each frame's URL (e.g. 'app.example.com'). Mutually exclusive with frameSelector. | |
| frameSelector | No | CSS selector of the <iframe> element; its content frame becomes active. Mutually exclusive with frameUrl. |