Skip to content

Commit

Permalink
not supportd
Browse files Browse the repository at this point in the history
  • Loading branch information
Rostislav Provodenko committed Jun 28, 2023
1 parent 8dac626 commit 59304ef
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/browser/existing-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,21 @@ module.exports = class ExistingBrowser extends Browser {
return this;
}

async getPuppeteer() {
try {
return await this._session.getPuppeteer();
} catch (e) {
// assuming browser does not support CDP
return null;
}
}

async _cycleBrowserContext() {
const puppeteer = await this._session.getPuppeteer();
const puppeteer = await this.getPuppeteer();
if (!puppeteer) {
return;
}

const currentOpenWindows = await this._session.getWindowHandles();
const context = await puppeteer.createIncognitoBrowserContext();
// first open the new page, then close the old pages, otherwise the session will close
Expand Down

0 comments on commit 59304ef

Please sign in to comment.