,

Deprecating CDP Support in Firefox: Embracing the Future with WebDriver BiDi

Posted by

Starting with Firefox 129 support for the Chrome DevTools Protocol (CDP) in Firefox will be deprecated. Users of CDP in Firefox are encouraged to migrate to the W3C WebDriver BiDi protocol. This now offers a superset of the features that were provided by Firefox’s CDP implementation.

During the depreciation period users have two choices to continue to use CDP with Firefox:

  • Use the ESR 128 release, which will continue to have the same behavior as today throughout its entire support period of about a year.
  • Set the remote.active-protocols preference to 2 before starting Firefox.
  • If WebDriver BiDi should be enabled as well, set the remote.active-protocols preference to 3.

Our current expectation is to remove the CDP support entirely at the end of 2024.

Notably, Puppeteer users are not affected by the deprecation of CDP, as Puppeteer automatically sets the necessary preference based on the selected protocol (CDP or BiDi)

If you have a client or tool that currently uses CDP and you wish to continue supporting Firefox, we would appreciate a brief notification, even if you do not need any assistance. Having a list of such clients will help us reach out with important information ahead of any future protocol changes.

Also in case of any questions about transitioning to WebDriver BiDi, or concerns about this change, please reach out to us.

Fore more details about the background to this change, read on.

The History of CDP Support in Firefox

The implementation of the Chrome DevTools Protocol (CDP) in Firefox began as an initiative to provide access to modern web testing tools like Puppeteer, Cypress, and Browsertime, which are widely used and largely rely on the CDP protocol. The development kicked off in 2019 with the introduction of the Remote Agent component in Firefox, and by early 2020 experimental support for CDP was made available in Firefox Nightly builds. A significant milestone was reached in February 2021 with the release of Firefox 86, where CDP support was enabled by default, supporting 82 APIs – a subset of the full range of APIs available through CDP.

Enhancing Cross-browser Testing with Firefox

In a two-part series on Mozilla Hacks, we already explored the challenges and advancements in cross-browser testing.

The first post, Cross-browser Testing, Part 1: Web App Testing Today, discusses the complexities of ensuring web applications function seamlessly across different browsers. It highlights the need for improved testing tools to address inconsistencies caused by varied web standard implementations.

The second post, Improving Cross-browser Testing, Part 2: New Automation Features in Firefox Nightly, introduces new automation features in Firefox Nightly. These enhancements include improved WebDriver support and the new WebDriver BiDi protocol, aimed at providing more robust and reliable automation tools for developers. Our efforts in these areas are designed to simplify cross-browser testing and improve interoperability between browsers.

Adopting WebDriver BiDi in Puppeteer

With the rise of WebDriver BiDi, the Puppeteer team began integrating support for this new protocol. Today, WebDriver BiDi in Firefox offers a broader range of features than its experimental CDP implementation, making it a more powerful and flexible option for web automation and testing. This includes features like using pre-load scripts to monitor DOM updates, network interception, and better logging, which are critical for modern web applications.

We’ve been working with the Puppeteer team to enable BiDi-based support for Firefox, offering more features and higher quality than the previous CDP-based implementation. This shift reflects the growing industry preference for a standardized, cross-browser automation protocol. We believe this change will significantly improve automation workflows and ensure compatibility across different browser environments. Stay tuned as we finalize the implementation of the remaining required APIs. Our goal is to provide a seamless and enhanced automation experience for all users.

Deprecation of CDP

As Firefox moves towards fully embracing WebDriver BiDi, CDP support in Firefox was put into limited maintenance mode. This means that no new features, aside from the existing automation-related APIs, have been or will be added any more. Also with tools like Selenium, Browsertime, and Puppeteer adopting WebDriver BiDi as their communication protocol, we see no reason to continue supporting CDP in Firefox. Therefore, starting with Firefox 129, the CDP protocol will no longer be enabled by default. However, Firefox 128 ESR will continue to have CDP enabled for another year, providing a transition period for users.

Please note that the deprecation of CDP will not impact Puppeteer users, as we will wait until Puppeteer uses WebDriver BiDi by default for Firefox.

However, if you are using a different CDP client, you can manually enable the protocol by setting the Firefox preference remote.active-protocols to 2 before starting Firefox or by restarting the browser. If WebDriver BiDi should be enabled as well, set the remote.active-protocols preference to 3. Nonetheless, we strongly recommend migrating to WebDriver BiDi, as support for CDP is scheduled to be fully removed by the end of 2024.

Support and Collaboration

If you have any questions about WebDriver BiDi, please feel free to reach out to us. You can contact us via the Google dev-webdriver mailing list or join the conversation on Matrix in the #webdriver channel. We are here to answer your questions and provide guidance on using WebDriver BiDi to communicate with Firefox effectively.

2 responses

  1. peterwx Avatar
    peterwx
    1. Henrik Skupin Avatar

Leave a Reply

Your email address will not be published. Required fields are marked *