Skip to content

Commit a1ff120

Browse files
committed
Set remote active protocol in Firefox to BiDi only
1 parent 6914339 commit a1ff120

File tree

10 files changed

+19
-19
lines changed

10 files changed

+19
-19
lines changed

dotnet/src/webdriver/Firefox/FirefoxOptions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ public FirefoxOptions()
8383
this.AddKnownCapabilityName(FirefoxOptions.FirefoxLegacyProfileCapability, "Profile property");
8484
this.AddKnownCapabilityName(FirefoxOptions.FirefoxLegacyBinaryCapability, "BrowserExecutableLocation property");
8585
this.AddKnownCapabilityName(FirefoxOptions.FirefoxEnableDevToolsProtocolCapability, "EnableDevToolsProtocol property");
86-
// Firefox 129 onwards the CDP protocol will not be enabled by default. Setting this preference will enable it.
8786
// https://fxdx.dev/deprecating-cdp-support-in-firefox-embracing-the-future-with-webdriver-bidi/.
88-
this.SetPreference("remote.active-protocols", 3);
87+
// Enable BiDi only
88+
this.SetPreference("remote.active-protocols", 1);
8989
}
9090

9191
/// <summary>

javascript/selenium-webdriver/firefox.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,9 @@ class Options extends Capabilities {
247247
constructor(other) {
248248
super(other)
249249
this.setBrowserName(Browser.FIREFOX)
250-
// Firefox 129 onwards the CDP protocol will not be enabled by default. Setting this preference will enable it.
251250
// https://fxdx.dev/deprecating-cdp-support-in-firefox-embracing-the-future-with-webdriver-bidi/.
252-
this.setPreference('remote.active-protocols', 3)
251+
// Enable BiDi only
252+
this.setPreference('remote.active-protocols', 1)
253253
}
254254

255255
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ suite(
9090
assert.deepStrictEqual(
9191
{
9292
androidPackage: 'org.mozilla.firefox',
93-
prefs: { 'remote.active-protocols': 3 },
93+
prefs: { 'remote.active-protocols': 1 },
9494
},
9595
firefoxOptions,
9696
)

py/selenium/webdriver/firefox/options.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ 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.
4847
# https://fxdx.dev/deprecating-cdp-support-in-firefox-embracing-the-future-with-webdriver-bidi/.
49-
self._preferences["remote.active-protocols"] = 3
48+
# Enable BiDi only
49+
self._preferences["remote.active-protocols"] = 1
5050
self._profile: Optional[FirefoxProfile] = None
5151
self.log = Log()
5252

py/test/selenium/webdriver/marionette/mn_options_tests.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class TestUnit:
4242
def test_ctor(self):
4343
opts = Options()
4444
assert opts.binary_location == ""
45-
assert opts._preferences == {"remote.active-protocols": 3}
45+
assert opts._preferences == {"remote.active-protocols": 1}
4646
assert opts._profile is None
4747
assert not opts._arguments
4848
assert isinstance(opts.log, Log)
@@ -72,7 +72,7 @@ def test_prefs(self):
7272
assert len(opts.preferences) == 3
7373
opts.set_preference("spam", "spam")
7474
assert len(opts.preferences) == 3
75-
assert opts.preferences == {"eggs": True, "remote.active-protocols": 3, "spam": "spam"}
75+
assert opts.preferences == {"eggs": True, "remote.active-protocols": 1, "spam": "spam"}
7676

7777
def test_profile(self, tmpdir_factory):
7878
opts = Options()
@@ -102,7 +102,7 @@ def test_to_capabilities(self):
102102
firefox_caps.update(
103103
{
104104
"pageLoadStrategy": PageLoadStrategy.normal,
105-
"moz:firefoxOptions": {"prefs": {"remote.active-protocols": 3}},
105+
"moz:firefoxOptions": {"prefs": {"remote.active-protocols": 1}},
106106
}
107107
)
108108
assert opts.to_capabilities() == firefox_caps

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

Lines changed: 1 addition & 1 deletion
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") == {"prefs": {"remote.active-protocols": 1}}
8383

8484

8585
def test_raises_exception_if_proxy_is_not_proxy_object(options):

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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"], "prefs": {"remote.active-protocols": 1}},
107107
},
108108
],
109109
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +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.
6867
# https://fxdx.dev/deprecating-cdp-support-in-firefox-embracing-the-future-with-webdriver-bidi/.
69-
@options[:prefs]['remote.active-protocols'] = 3
68+
# Enable BiDi only
69+
@options[:prefs]['remote.active-protocols'] = 1
7070
@options[:env] ||= {}
7171
@options[:log] ||= {level: log_level} if log_level
7272

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

Lines changed: 1 addition & 1 deletion
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': {prefs: {'remote.active-protocols' => 1}},
4242
'moz:debuggerAddress': true}}}).to_json
4343
endpoint ||= "#{service_manager.uri}/session"
4444
stub_request(:post, endpoint).with(body: body).to_return(valid_response)

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

Lines changed: 4 additions & 4 deletions
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', 'remote.active-protocols' => 1}
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' => {'prefs' => {'remote.active-protocols' => 1}},
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' => {'prefs' => {'remote.active-protocols' => 1}})
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', 'remote.active-protocols' => 1},
244244
'env' => {'FOO' => 'bar'},
245245
'profile' => 'encoded_profile',
246246
'log' => {'level' => 'debug'},

0 commit comments

Comments
 (0)