Skip to content

Commit 43403c0

Browse files
committed
Add preference to enable CDP in Firefox by default
Related to SeleniumHQ#11736
1 parent e98cc84 commit 43403c0

File tree

5 files changed

+16
-0
lines changed

5 files changed

+16
-0
lines changed

dotnet/src/webdriver/Firefox/FirefoxOptions.cs

+3
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ public FirefoxOptions()
8888
this.AddKnownCapabilityName(FirefoxOptions.FirefoxLegacyProfileCapability, "Profile property");
8989
this.AddKnownCapabilityName(FirefoxOptions.FirefoxLegacyBinaryCapability, "BrowserExecutableLocation property");
9090
this.AddKnownCapabilityName(FirefoxOptions.FirefoxEnableDevToolsProtocolCapability, "EnableDevToolsProtocol property");
91+
// Firefox 129 onwards the CDP protocol will not be enabled by default. Setting this preference will enable it.
92+
// https://fxdx.dev/deprecating-cdp-support-in-firefox-embracing-the-future-with-webdriver-bidi/.
93+
this.SetPreference("remote.active-protocols", 2);
9194
}
9295

9396
/// <summary>

java/src/org/openqa/selenium/firefox/FirefoxOptions.java

+4
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ public FirefoxOptions() {
6363
setCapability(CapabilityType.BROWSER_NAME, FIREFOX.browserName());
6464
setAcceptInsecureCerts(true);
6565
setCapability("moz:debuggerAddress", true);
66+
// Firefox 129 onwards the CDP protocol will not be enabled by default. Setting this preference
67+
// will enable it.
68+
// https://fxdx.dev/deprecating-cdp-support-in-firefox-embracing-the-future-with-webdriver-bidi/.
69+
addPreference("remote.active-protocols", 2);
6670
}
6771

6872
public FirefoxOptions(Capabilities source) {

javascript/node/selenium-webdriver/firefox.js

+3
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,9 @@ class Options extends Capabilities {
246246
constructor(other) {
247247
super(other)
248248
this.setBrowserName(Browser.FIREFOX)
249+
// Firefox 129 onwards the CDP protocol will not be enabled by default. Setting this preference will enable it.
250+
// https://fxdx.dev/deprecating-cdp-support-in-firefox-embracing-the-future-with-webdriver-bidi/.
251+
this.setPreference('remote.active-protocols', 2)
249252
}
250253

251254
/**

py/selenium/webdriver/firefox/options.py

+3
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ def __init__(self) -> None:
4141
super().__init__()
4242
self._binary_location = ""
4343
self._preferences: dict = {}
44+
# Firefox 129 onwards the CDP protocol will not be enabled by default. Setting this preference will enable it.
45+
# https://fxdx.dev/deprecating-cdp-support-in-firefox-embracing-the-future-with-webdriver-bidi/.
46+
self._preferences["remote.active-protocols"] = 2
4447
self._profile = None
4548
self.log = Log()
4649

rb/lib/selenium/webdriver/firefox/options.rb

+3
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ def initialize(log_level: nil, **opts)
6464

6565
@options[:args] ||= []
6666
@options[:prefs] ||= {}
67+
# Firefox 129 onwards the CDP protocol will not be enabled by default. Setting this preference will enable it.
68+
# https://fxdx.dev/deprecating-cdp-support-in-firefox-embracing-the-future-with-webdriver-bidi/.
69+
@options[:prefs]['remote.active-protocols'] = 2
6770
@options[:env] ||= {}
6871
@options[:log] ||= {level: log_level} if log_level
6972

0 commit comments

Comments
 (0)