Version: 1.8.0
ChromiumBrowserContext
- extends: BrowserContext
Chromium-specific features including background pages, service worker support, etc.
- chromiumBrowserContext.on('backgroundpage')
- chromiumBrowserContext.on('serviceworker')
- chromiumBrowserContext.backgroundPages()
- chromiumBrowserContext.newCDPSession(page)
- chromiumBrowserContext.serviceWorkers()
- browserContext.on('close')
- browserContext.on('page')
- browserContext.addCookies(cookies)
- browserContext.addInitScript(script[, arg])
- browserContext.browser()
- browserContext.clearCookies()
- browserContext.clearPermissions()
- browserContext.close()
- browserContext.cookies([urls])
- browserContext.exposeBinding(name, callback[, options])
- browserContext.exposeFunction(name, callback)
- browserContext.grantPermissions(permissions[, options])
- browserContext.newPage()
- browserContext.pages()
- browserContext.route(url, handler)
- browserContext.setDefaultNavigationTimeout(timeout)
- browserContext.setDefaultTimeout(timeout)
- browserContext.setExtraHTTPHeaders(headers)
- browserContext.setGeolocation(geolocation)
- browserContext.setHTTPCredentials(httpCredentials)
- browserContext.setOffline(offline)
- browserContext.storageState([options])
- browserContext.unroute(url[, handler])
- browserContext.waitForEvent(event[, optionsOrPredicate])
#
chromiumBrowserContext.on('backgroundpage')- type: <Page>
Emitted when new background page is created in the context.
note
Only works with persistent context.
#
chromiumBrowserContext.on('serviceworker')- type: <Worker>
Emitted when new service worker is created in the context.
#
chromiumBrowserContext.backgroundPages()All existing background pages in the context.
#
chromiumBrowserContext.newCDPSession(page)page
<Page> Page to create new session for.- returns: <Promise<CDPSession>>
Returns the newly created session.
#
chromiumBrowserContext.serviceWorkers()All existing service workers in the context.