Class: Playwright::ChromiumBrowserContext
- Inherits:
-
BrowserContext
- Object
- PlaywrightApi
- BrowserContext
- Playwright::ChromiumBrowserContext
- Defined in:
- lib/playwright_api/chromium_browser_context.rb
Overview
-
extends: ‘BrowserContext`
Chromium-specific features including background pages, service worker support, etc.
“‘js const backgroundPage = await context.waitForEvent(’backgroundpage’); “‘
“‘python async background_page = await context.wait_for_event(“backgroundpage”) “`
“‘python sync background_page = context.wait_for_event(“backgroundpage”) “`
Instance Method Summary collapse
-
#background_pages ⇒ Object
All existing background pages in the context.
-
#new_cdp_session(page) ⇒ Object
Returns the newly created session.
-
#off(event, callback) ⇒ Object
– inherited from EventEmitter –.
-
#on(event, callback) ⇒ Object
– inherited from EventEmitter –.
-
#once(event, callback) ⇒ Object
– inherited from EventEmitter –.
-
#service_workers ⇒ Object
All existing service workers in the context.
Methods inherited from BrowserContext
#add_cookies, #add_init_script, #browser, #browser=, #clear_cookies, #clear_permissions, #close, #cookies, #expect_event, #expect_page, #expose_binding, #expose_function, #grant_permissions, #new_page, #options=, #owner_page=, #pages, #pause, #route, #set_default_navigation_timeout, #set_default_timeout, #set_extra_http_headers, #set_geolocation, #set_offline, #storage_state, #unroute, #wait_for_event
Methods inherited from PlaywrightApi
Constructor Details
This class inherits a constructor from Playwright::PlaywrightApi
Instance Method Details
#background_pages ⇒ Object
All existing background pages in the context.
23 24 25 |
# File 'lib/playwright_api/chromium_browser_context.rb', line 23 def background_pages raise NotImplementedError.new('background_pages is not implemented yet.') end |
#new_cdp_session(page) ⇒ Object
Returns the newly created session.
28 29 30 |
# File 'lib/playwright_api/chromium_browser_context.rb', line 28 def new_cdp_session(page) raise NotImplementedError.new('new_cdp_session is not implemented yet.') end |
#off(event, callback) ⇒ Object
– inherited from EventEmitter –
39 40 41 |
# File 'lib/playwright_api/chromium_browser_context.rb', line 39 def off(event, callback) event_emitter_proxy.off(event, callback) end |
#on(event, callback) ⇒ Object
– inherited from EventEmitter –
51 52 53 |
# File 'lib/playwright_api/chromium_browser_context.rb', line 51 def on(event, callback) event_emitter_proxy.on(event, callback) end |
#once(event, callback) ⇒ Object
– inherited from EventEmitter –
45 46 47 |
# File 'lib/playwright_api/chromium_browser_context.rb', line 45 def once(event, callback) event_emitter_proxy.once(event, callback) end |
#service_workers ⇒ Object
All existing service workers in the context.
33 34 35 |
# File 'lib/playwright_api/chromium_browser_context.rb', line 33 def service_workers raise NotImplementedError.new('service_workers is not implemented yet.') end |