Version: 1.3.0

ChromiumBrowserContext

Chromium-specific features including background pages, service worker support, etc.

const backgroundPage = await context.waitForEvent('backgroundpage');

event: 'backgroundpage'#

Emitted when new background page is created in the context.

NOTE Only works with persistent context.

event: 'serviceworker'#

Emitted when new service worker is created in the context.

chromiumBrowserContext.backgroundPages()#

  • returns: <Array<Page>> All existing background pages in the context.

chromiumBrowserContext.newCDPSession(page)#

  • page <Page> Page to create new session for.
  • returns: <Promise<CDPSession>> Promise that resolves to the newly created session.

chromiumBrowserContext.serviceWorkers()#

  • returns: <Array<Worker>> All existing service workers in the context.