Skip to main content
Glama

browser_switch_to_parent_frame

Switch back to the main webpage from an embedded iframe to continue browser automation tasks.

Instructions

Switches to the parent iframe

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler for the 'browser_switch_to_parent_frame' tool. Registers the tool with MCP server and implements the logic by calling ElementService.switchToParentFrame(). Returns success or error message.
    server.tool('browser_switch_to_parent_frame', 'Switches to the parent iframe', async () => { try { const driver = stateManager.getDriver(); const elementService = new ElementService(driver); await elementService.switchToParentFrame(); return { content: [{ type: 'text', text: 'Switched to parent frame' }], }; } catch (e) { return { content: [ { type: 'text', text: `Error switching to parent frame: ${(e as Error).message}`, }, ], }; } });
  • Core helper method in ElementService that performs the actual switch to parent frame using Selenium WebDriver's switchTo().parentFrame().
    async switchToParentFrame(): Promise<void> { await this.driver.switchTo().parentFrame(); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pshivapr/selenium-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server