Version: 1.8.0
ChromiumBrowserContext
- extends: BrowserContext
Chromium-specific features including background pages, service worker support, etc.
- Sync
- Async
- chromium_browser_context.on("backgroundpage")
- chromium_browser_context.on("serviceworker")
- chromium_browser_context.background_pages
- chromium_browser_context.new_cdp_session(page)
- chromium_browser_context.service_workers
- browser_context.on("close")
- browser_context.on("page")
- browser_context.add_cookies(cookies)
- browser_context.add_init_script(**kwargs)
- browser_context.browser
- browser_context.clear_cookies()
- browser_context.clear_permissions()
- browser_context.close()
- browser_context.cookies(**kwargs)
- browser_context.expect_event(event, **kwargs)
- browser_context.expect_page(**kwargs)
- browser_context.expose_binding(name, callback, **kwargs)
- browser_context.expose_function(name, callback)
- browser_context.grant_permissions(permissions, **kwargs)
- browser_context.new_page()
- browser_context.pages
- browser_context.route(url, handler)
- browser_context.set_default_navigation_timeout(timeout)
- browser_context.set_default_timeout(timeout)
- browser_context.set_extra_http_headers(headers)
- browser_context.set_geolocation(geolocation)
- browser_context.set_offline(offline)
- browser_context.storage_state(**kwargs)
- browser_context.unroute(url, **kwargs)
- browser_context.wait_for_event(event, **kwargs)
#
chromium_browser_context.on("backgroundpage")- type: <Page>
Emitted when new background page is created in the context.
note
Only works with persistent context.
#
chromium_browser_context.on("serviceworker")- type: <Worker>
Emitted when new service worker is created in the context.
#
chromium_browser_context.background_pagesAll existing background pages in the context.
#
chromium_browser_context.new_cdp_session(page)page
<Page> Page to create new session for.- returns: <CDPSession>
Returns the newly created session.
#
chromium_browser_context.service_workersAll existing service workers in the context.