Version: 1.8.0
ChromiumBrowser
- extends: Browser
Chromium-specific features including Tracing, service worker support, etc. You can use chromiumBrowser.startTracing([page, options]) and chromiumBrowser.stopTracing() to create a trace file which can be opened in Chrome DevTools or timeline viewer.
ChromiumBrowser can also be used for testing Chrome Extensions.
note
Extensions in Chrome / Chromium currently only work in non-headless mode.
The following is code for getting a handle to the background page of an extension whose source is located in ./my-extension
:
- chromiumBrowser.newBrowserCDPSession()
- chromiumBrowser.startTracing([page, options])
- chromiumBrowser.stopTracing()
- browser.on('disconnected')
- browser.close()
- browser.contexts()
- browser.isConnected()
- browser.newContext([options])
- browser.newPage([options])
- browser.version()
#
chromiumBrowser.newBrowserCDPSession()- returns: <Promise<CDPSession>>
Returns the newly created browser session.
#
chromiumBrowser.startTracing([page, options])Only one trace can be active at a time per browser.
#
chromiumBrowser.stopTracing()Returns the buffer with trace data.