Version: 1.8.0

ChromiumBrowserContext

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

background_page = context.wait_for_event("backgroundpage")

chromium_browser_context.on("backgroundpage")#

Emitted when new background page is created in the context.

note

Only works with persistent context.

chromium_browser_context.on("serviceworker")#

Emitted when new service worker is created in the context.

chromium_browser_context.background_pages#

All existing background pages in the context.

chromium_browser_context.new_cdp_session(page)#

Returns the newly created session.

chromium_browser_context.service_workers#

All existing service workers in the context.