From ff112bc8b3401200e9bb8aa78c4f9a7aa0010c21 Mon Sep 17 00:00:00 2001 From: Puja Jagani Date: Fri, 7 Jun 2024 14:15:04 +0530 Subject: [PATCH] Update the Firefox preference to activate both CDP and WebDriver BiDi --- .../src/webdriver/Firefox/FirefoxOptions.cs | 2 +- java/.idea/workspace.xml | 49 +++++++++++++++++++ .../selenium/firefox/FirefoxOptions.java | 2 +- javascript/node/selenium-webdriver/firefox.js | 2 +- py/selenium/webdriver/firefox/options.py | 2 +- rb/lib/selenium/webdriver/firefox/options.rb | 2 +- 6 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 java/.idea/workspace.xml diff --git a/dotnet/src/webdriver/Firefox/FirefoxOptions.cs b/dotnet/src/webdriver/Firefox/FirefoxOptions.cs index 6b74548096ed6..b2eb933805526 100644 --- a/dotnet/src/webdriver/Firefox/FirefoxOptions.cs +++ b/dotnet/src/webdriver/Firefox/FirefoxOptions.cs @@ -90,7 +90,7 @@ public FirefoxOptions() this.AddKnownCapabilityName(FirefoxOptions.FirefoxEnableDevToolsProtocolCapability, "EnableDevToolsProtocol property"); // Firefox 129 onwards the CDP protocol will not be enabled by default. Setting this preference will enable it. // https://fxdx.dev/deprecating-cdp-support-in-firefox-embracing-the-future-with-webdriver-bidi/. - this.SetPreference("remote.active-protocols", 2); + this.SetPreference("remote.active-protocols", 3); } /// diff --git a/java/.idea/workspace.xml b/java/.idea/workspace.xml new file mode 100644 index 0000000000000..c24b8f6be3837 --- /dev/null +++ b/java/.idea/workspace.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + 1717749164217 + + + + + + + \ No newline at end of file diff --git a/java/src/org/openqa/selenium/firefox/FirefoxOptions.java b/java/src/org/openqa/selenium/firefox/FirefoxOptions.java index 15937b5a8a32c..6f514c79aec60 100644 --- a/java/src/org/openqa/selenium/firefox/FirefoxOptions.java +++ b/java/src/org/openqa/selenium/firefox/FirefoxOptions.java @@ -66,7 +66,7 @@ public FirefoxOptions() { // Firefox 129 onwards the CDP protocol will not be enabled by default. Setting this preference // will enable it. // https://fxdx.dev/deprecating-cdp-support-in-firefox-embracing-the-future-with-webdriver-bidi/. - addPreference("remote.active-protocols", 2); + addPreference("remote.active-protocols", 3); } public FirefoxOptions(Capabilities source) { diff --git a/javascript/node/selenium-webdriver/firefox.js b/javascript/node/selenium-webdriver/firefox.js index 20883116a8f12..f6cd1cf1e9d7e 100644 --- a/javascript/node/selenium-webdriver/firefox.js +++ b/javascript/node/selenium-webdriver/firefox.js @@ -248,7 +248,7 @@ class Options extends Capabilities { this.setBrowserName(Browser.FIREFOX) // Firefox 129 onwards the CDP protocol will not be enabled by default. Setting this preference will enable it. // https://fxdx.dev/deprecating-cdp-support-in-firefox-embracing-the-future-with-webdriver-bidi/. - this.setPreference('remote.active-protocols', 2) + this.setPreference('remote.active-protocols', 3) } /** diff --git a/py/selenium/webdriver/firefox/options.py b/py/selenium/webdriver/firefox/options.py index 7d75f52c35d6a..b16622b03dd93 100644 --- a/py/selenium/webdriver/firefox/options.py +++ b/py/selenium/webdriver/firefox/options.py @@ -43,7 +43,7 @@ def __init__(self) -> None: self._preferences: dict = {} # Firefox 129 onwards the CDP protocol will not be enabled by default. Setting this preference will enable it. # https://fxdx.dev/deprecating-cdp-support-in-firefox-embracing-the-future-with-webdriver-bidi/. - self._preferences["remote.active-protocols"] = 2 + self._preferences["remote.active-protocols"] = 3 self._profile = None self.log = Log() diff --git a/rb/lib/selenium/webdriver/firefox/options.rb b/rb/lib/selenium/webdriver/firefox/options.rb index 61d830489cfcf..c702600b3bc28 100644 --- a/rb/lib/selenium/webdriver/firefox/options.rb +++ b/rb/lib/selenium/webdriver/firefox/options.rb @@ -66,7 +66,7 @@ def initialize(log_level: nil, **opts) @options[:prefs] ||= {} # Firefox 129 onwards the CDP protocol will not be enabled by default. Setting this preference will enable it. # https://fxdx.dev/deprecating-cdp-support-in-firefox-embracing-the-future-with-webdriver-bidi/. - @options[:prefs]['remote.active-protocols'] = 2 + @options[:prefs]['remote.active-protocols'] = 3 @options[:env] ||= {} @options[:log] ||= {level: log_level} if log_level