Frames, Shadow DOM & Scoping

Switch To Default Content

Sets the element search root back to the top level document, so selectors look at the whole page again. It is what undoes InFrame and InShadowDom, and it changes nothing about the page itself, only where GPAL looks for the elements a selector names.

Examples

GPAL Fluent: High-level fluent C# API

browser.InMainDom();

MagicHelper: MagicHelper utility library

browser.MagicHelper.SwitchToDefaultContent();

Puppeteer Client: Puppeteer-style C# client

browser.PuppeteerClient.SwitchToDefaultContent().Execute();

Puppeteer Communicator: Low-level communicator

//InMainDom is the name the browser and MagicHelper use for this. The communicator calls it SwitchToDefaultContent.

await browser.PuppeteerCommunicator.SwitchToDefaultContent(string sessionId);

REST Client: Direct REST/HTTP client

browser.OttoMagicClient.WithEndpoint(ApiEndpoint.SwitchToDefaultContent).Execute();

💬 Ask GPAL