Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: experimental WebDriver BiDi support with Firefox #11412

Merged
merged 10 commits into from Nov 28, 2023
Merged

Conversation

OrKoN
Copy link
Collaborator

@OrKoN OrKoN commented Nov 17, 2023

Previously, it was possible to use Firefox with Puppeteer relying on the Firefox's implementation of a subset of CDP. WebDriver BiDi is a new cross-browser automation protocol similar to CDP but unlike CDP it's a W3C standard meaning that it is well defined and easier to implement by the browser vendors.

This PR releases the option to turn on WebDriver BiDi when launching Firefox and use WebDriver BiDi instead of CDP to communicate with Firefox. The support level of the new protocol for Firefox is experimental and we are looking for your feedback!

The Puppeteer's WebDriver BiDi feature set for Firefox is almost the same as the previous CDP support. Few features that are still missing:

  1. page.cookies and cookie management
  2. puppeteer.connect
  3. user agent emulation

We are constantly working on bringing new features and you can track the progress here and we hope to add support for remaining APIs and Chrome soon. Check out the WebDriver BiDi support to see if a particular API is supported with WebDriver BiDi.

Example of launching Firefox with WebDriver BiDi:

import puppeteer from 'puppeteer';

const browser = await puppeteer.launch({
  product: 'firefox',
  protocol: 'webDriverBiDi',
});
const page = await browser.newPage();
...
await browser.close();

@OrKoN OrKoN force-pushed the orkon/firefox-bidi branch 8 times, most recently from 55ae0bd to a835641 Compare November 20, 2023 09:35
@OrKoN
Copy link
Collaborator Author

OrKoN commented Nov 20, 2023

@sadym-chromium @mathiasbynens PTAL. Any suggestions on the content for faq.md or any suggestions to document BiDi better?

@OrKoN OrKoN marked this pull request as ready for review November 20, 2023 10:17
@sadym-chromium
Copy link
Collaborator

@sadym-chromium @mathiasbynens PTAL. Any suggestions on the content for faq.md or any suggestions to document BiDi better?

Q: Does Puppeteer support WebDriver BiDi?

Copy link
Collaborator

@sadym-chromium sadym-chromium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. We have quite good FF + BiDi support for announcing it as experimental.

@OrKoN OrKoN force-pushed the orkon/firefox-bidi branch 2 times, most recently from 73f175f to 4d6a7cc Compare November 23, 2023 11:39
@OrKoN
Copy link
Collaborator Author

OrKoN commented Nov 23, 2023

After discussing with @jecfish and testing the website with these changes locally I think it might be better if we create a new page about WebDriver BiDi where we list what is supported and what is not. WDYT?

@OrKoN OrKoN marked this pull request as draft November 23, 2023 14:15
docs/webdriver-bidi.md Outdated Show resolved Hide resolved
docs/webdriver-bidi.md Outdated Show resolved Hide resolved
docs/webdriver-bidi.md Outdated Show resolved Hide resolved
@jecfish
Copy link
Contributor

jecfish commented Nov 23, 2023

Added a few comments on the docs. Otherwise, LGTM.

@OrKoN OrKoN force-pushed the orkon/firefox-bidi branch 5 times, most recently from d37946b to 25292f6 Compare November 24, 2023 10:27
@OrKoN OrKoN marked this pull request as ready for review November 27, 2023 09:16
@OrKoN OrKoN force-pushed the orkon/firefox-bidi branch 2 times, most recently from ddab3f2 to 23a4d9c Compare November 27, 2023 12:17
@OrKoN OrKoN force-pushed the orkon/firefox-bidi branch 2 times, most recently from 4a0a511 to b182157 Compare November 28, 2023 07:54
packages/puppeteer-core/src/api/Target.ts Outdated Show resolved Hide resolved
docs/webdriver-bidi.md Outdated Show resolved Hide resolved
docs/webdriver-bidi.md Outdated Show resolved Hide resolved
docs/webdriver-bidi.md Show resolved Hide resolved
docs/webdriver-bidi.md Outdated Show resolved Hide resolved
@OrKoN OrKoN force-pushed the orkon/firefox-bidi branch 2 times, most recently from bc6ffa7 to e50baba Compare November 28, 2023 11:31
@OrKoN OrKoN merged commit 8aba033 into main Nov 28, 2023
52 checks passed
@OrKoN OrKoN deleted the orkon/firefox-bidi branch November 28, 2023 12:07
@release-please release-please bot mentioned this pull request Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants