Skip to content

Commit e475abb

Browse files
committed
Revert "Add preference to enable CDP in Firefox by default (SeleniumHQ#14091)"
This reverts commit a4d1b02.
1 parent 9a3390d commit e475abb

File tree

10 files changed

+10
-34
lines changed

10 files changed

+10
-34
lines changed

dotnet/src/webdriver/Firefox/FirefoxOptions.cs

-3
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ public FirefoxOptions()
8585
this.AddKnownCapabilityName(FirefoxOptions.FirefoxLegacyProfileCapability, "Profile property");
8686
this.AddKnownCapabilityName(FirefoxOptions.FirefoxLegacyBinaryCapability, "BrowserExecutableLocation property");
8787
this.AddKnownCapabilityName(FirefoxOptions.FirefoxEnableDevToolsProtocolCapability, "EnableDevToolsProtocol property");
88-
// Firefox 129 onwards the CDP protocol will not be enabled by default. Setting this preference will enable it.
89-
// https://fxdx.dev/deprecating-cdp-support-in-firefox-embracing-the-future-with-webdriver-bidi/.
90-
this.SetPreference("remote.active-protocols", 3);
9188
}
9289

9390
/// <summary>

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

-4
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,6 @@ 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", 3);
7066
}
7167

7268
public FirefoxOptions(Capabilities source) {

javascript/node/selenium-webdriver/firefox.js

-3
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,6 @@ 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', 3)
252249
}
253250

254251
/**

javascript/node/selenium-webdriver/test/firefox/options_test.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,7 @@ suite(
8787
it('allows setting android activity', function () {
8888
let options = new firefox.Options().enableMobile()
8989
let firefoxOptions = options.firefoxOptions_()
90-
assert.deepStrictEqual(
91-
{
92-
androidPackage: 'org.mozilla.firefox',
93-
prefs: { 'remote.active-protocols': 3 },
94-
},
95-
firefoxOptions,
96-
)
90+
assert.deepStrictEqual({ androidPackage: 'org.mozilla.firefox' }, firefoxOptions)
9791
})
9892
})
9993

py/selenium/webdriver/firefox/options.py

-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ def __init__(self) -> None:
4444
super().__init__()
4545
self._binary_location = ""
4646
self._preferences: dict = {}
47-
# Firefox 129 onwards the CDP protocol will not be enabled by default. Setting this preference will enable it.
48-
# https://fxdx.dev/deprecating-cdp-support-in-firefox-embracing-the-future-with-webdriver-bidi/.
4947
self._preferences["remote.active-protocols"] = 3
5048
self._profile: Optional[FirefoxProfile] = None
5149
self.log = Log()

py/test/unit/selenium/webdriver/firefox/firefox_options_tests.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def test_set_proxy_isnt_in_moz_prefix(options):
7979

8080
caps = options.to_capabilities()
8181
assert caps["proxy"]["proxyType"] == "manual"
82-
assert caps.get("moz:firefoxOptions") == {"prefs": {"remote.active-protocols": 3}}
82+
assert caps.get("moz:firefoxOptions") is None
8383

8484

8585
def test_raises_exception_if_proxy_is_not_proxy_object(options):

py/test/unit/selenium/webdriver/remote/new_session_tests.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def test_works_as_context_manager(mocker):
5252

5353

5454
@pytest.mark.parametrize("browser_name", ["firefox", "chrome", "ie"])
55-
def test_acepts_options_to_remote_driver(mocker, browser_name):
55+
def test_accepts_options_to_remote_driver(mocker, browser_name):
5656
options = import_module(f"selenium.webdriver.{browser_name}.options")
5757
mock = mocker.patch("selenium.webdriver.remote.webdriver.WebDriver.start_session")
5858

@@ -103,7 +103,7 @@ def test_first_match_when_2_different_option_types():
103103
"browserName": "firefox",
104104
"acceptInsecureCerts": True,
105105
"moz:debuggerAddress": True,
106-
"moz:firefoxOptions": {"args": ["foo"], "prefs": {"remote.active-protocols": 3}},
106+
"moz:firefoxOptions": {"args": ["foo"]},
107107
},
108108
],
109109
}

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

-3
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ 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'] = 3
7067
@options[:env] ||= {}
7168
@options[:log] ||= {level: log_level} if log_level
7269

rb/spec/unit/selenium/webdriver/firefox/driver_spec.rb

+2-5
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module Firefox
3838
def expect_request(body: nil, endpoint: nil)
3939
body = (body || {capabilities: {alwaysMatch: {acceptInsecureCerts: true,
4040
browserName: 'firefox',
41-
'moz:firefoxOptions': {prefs: {'remote.active-protocols' => 3}},
41+
'moz:firefoxOptions': {},
4242
'moz:debuggerAddress': true}}}).to_json
4343
endpoint ||= "#{service_manager.uri}/session"
4444
stub_request(:post, endpoint).with(body: body).to_return(valid_response)
@@ -79,10 +79,7 @@ def expect_request(body: nil, endpoint: nil)
7979
opts = {args: ['-f']}
8080
expect_request(body: {capabilities: {alwaysMatch: {acceptInsecureCerts: true,
8181
browserName: 'firefox',
82-
'moz:firefoxOptions': {
83-
args: ['-f'],
84-
prefs: {'remote.active-protocols' => 3}
85-
},
82+
'moz:firefoxOptions': opts,
8683
'moz:debuggerAddress': true}}})
8784
expect { described_class.new(options: Options.new(**opts)) }.not_to raise_exception
8885
end

rb/spec/unit/selenium/webdriver/firefox/options_spec.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ module Firefox
154154
options.add_preference('intl.accepted_languages', 'en-US')
155155

156156
prefs = options.as_json['moz:firefoxOptions']['prefs']
157-
expected = {'intl.accepted_languages' => 'en-US', 'remote.active-protocols' => 3}
157+
expected = {'intl.accepted_languages' => 'en-US'}
158158
expect(prefs).to eq(expected)
159159
end
160160
end
@@ -185,7 +185,7 @@ module Firefox
185185
it 'returns empty options by default' do
186186
expect(options.as_json).to eq('browserName' => 'firefox',
187187
'acceptInsecureCerts' => true,
188-
'moz:firefoxOptions' => {'prefs' => {'remote.active-protocols' => 3}},
188+
'moz:firefoxOptions' => {},
189189
'moz:debuggerAddress' => true)
190190
end
191191

@@ -195,7 +195,7 @@ module Firefox
195195
'browserName' => 'firefox',
196196
'foo:bar' => {'foo' => 'bar'},
197197
'moz:debuggerAddress' => true,
198-
'moz:firefoxOptions' => {'prefs' => {'remote.active-protocols' => 3}})
198+
'moz:firefoxOptions' => {})
199199
end
200200

201201
it 'converts to a json hash' do
@@ -240,7 +240,7 @@ module Firefox
240240
'moz:debuggerAddress' => true,
241241
key => {'args' => %w[foo bar],
242242
'binary' => '/foo/bar',
243-
'prefs' => {'foo' => 'bar', 'remote.active-protocols' => 3},
243+
'prefs' => {'foo' => 'bar'},
244244
'env' => {'FOO' => 'bar'},
245245
'profile' => 'encoded_profile',
246246
'log' => {'level' => 'debug'},

0 commit comments

Comments
 (0)