docs/webdriver-bidi.md
WebDriver BiDi is a new cross-browser automation protocol currently under development, aiming to combine the best of both WebDriver “Classic” and CDP. WebDriver BiDi enables bi-directional communication, making it fast by default, and it comes packed with low-level control.
Puppeteer supports WebDriver BiDi automation with Chrome and Firefox.
When launching Firefox with Puppeteer, the WebDriver BiDi Protocol is
enabled by default. When launching Chrome, CDP is still used by default
since not all CDP features are supported by WebDriver BiDi yet. If a
certain Puppeteer feature is not supported over WebDriver BiDi yet,
UnsupportedOperation
error is thrown. Also see the lists below on what is supported with
WebDriver BiDi.
Below is an example of launching Firefox or Chrome with WebDriver BiDi:
import puppeteer from 'puppeteer';
const firefoxBrowser = await puppeteer.launch({
browser: 'firefox', // WebDriver BiDi is used by default.
});
const page = await firefoxBrowser.newPage();
...
await firefoxBrowser.close();
const chromeBrowser = await puppeteer.launch({
browser: 'chrome',
protocol: 'webDriverBiDi', // CDP would be used by default for Chrome.
});
const page = await chromeBrowser.newPage();
...
await chromeBrowser.close();
Various emulations
CDP-specific features
Accessibility
Coverage
Tracing
Other methods:
Browser automation
Page automation
referer and referrerPolicy)referer and referrerPolicy)ignoreCache parameter)width, height, deviceScaleFactor only)Selectors and locators except for ARIA:
Input
JavaScript dialog interception
Screenshots (not all parameters are supported)
clip, encoding, fullPage)PDF generation (not all parameters are supported)
format, height, landscape, margin, pageRanges, printBackground, scale, width are supported)format, height, landscape, margin, pageRanges, printBackground, scale, width are supported)Permissions
Various emulations