devtools
Version:
A Chrome DevTools protocol binding that maps WebDriver commands into Chrome DevTools commands using Puppeteer
23 lines (22 loc) • 722 B
JavaScript
/**
* The Switch to Parent Frame command sets the current browsing context for future commands
* to the parent of the current browsing context.
*
* @alias browser.switchToParentFrame
* @see https://w3c.github.io/webdriver/#dfn-switch-to-parent-frame
*/
export default async function switchToParentFrame() {
const page = this.getPageHandle(true);
/**
* check if we can access child frames, if now we are already in the
* parent browsing context
*/
if (typeof page.parentFrame !== 'function') {
return null;
}
/**
* ToDo(Christian): investigate why we interchangeably use Page and Frames here
*/
this.currentFrame = await page.parentFrame();
return null;
}