Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions dotnet/src/webdriver/Firefox/FirefoxOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ public FirefoxOptions()
this.AddKnownCapabilityName(FirefoxOptions.FirefoxLegacyProfileCapability, "Profile property");
this.AddKnownCapabilityName(FirefoxOptions.FirefoxLegacyBinaryCapability, "BrowserExecutableLocation property");
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", 3);
}

/// <summary>
Expand Down
4 changes: 0 additions & 4 deletions java/src/org/openqa/selenium/firefox/FirefoxOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ public class FirefoxOptions extends AbstractDriverOptions<FirefoxOptions> {
public FirefoxOptions() {
setCapability(CapabilityType.BROWSER_NAME, FIREFOX.browserName());
setAcceptInsecureCerts(true);
// 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", 3);
}

public FirefoxOptions(Capabilities source) {
Expand Down
3 changes: 0 additions & 3 deletions javascript/node/selenium-webdriver/firefox.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,6 @@ class Options extends Capabilities {
constructor(other) {
super(other)
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', 3)
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,7 @@ suite(
it('allows setting android activity', function () {
let options = new firefox.Options().enableMobile()
let firefoxOptions = options.firefoxOptions_()
assert.deepStrictEqual(
{
androidPackage: 'org.mozilla.firefox',
prefs: { 'remote.active-protocols': 3 },
},
firefoxOptions,
)
assert.deepStrictEqual({ androidPackage: 'org.mozilla.firefox' }, firefoxOptions)
})
})

Expand Down
2 changes: 0 additions & 2 deletions py/selenium/webdriver/firefox/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ def __init__(self) -> None:
super().__init__()
self._binary_location = ""
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"] = 3
self._profile: Optional[FirefoxProfile] = None
self.log = Log()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def test_set_proxy_isnt_in_moz_prefix(options):

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


def test_raises_exception_if_proxy_is_not_proxy_object(options):
Expand Down
4 changes: 2 additions & 2 deletions py/test/unit/selenium/webdriver/remote/new_session_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test_works_as_context_manager(mocker):


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

Expand Down Expand Up @@ -103,7 +103,7 @@ def test_first_match_when_2_different_option_types():
"browserName": "firefox",
"acceptInsecureCerts": True,
"moz:debuggerAddress": True,
"moz:firefoxOptions": {"args": ["foo"], "prefs": {"remote.active-protocols": 3}},
"moz:firefoxOptions": {"args": ["foo"]},
},
],
}
Expand Down
3 changes: 0 additions & 3 deletions rb/lib/selenium/webdriver/firefox/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ def initialize(log_level: nil, **opts)

@options[:args] ||= []
@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'] = 3
@options[:env] ||= {}
@options[:log] ||= {level: log_level} if log_level

Expand Down
7 changes: 2 additions & 5 deletions rb/spec/unit/selenium/webdriver/firefox/driver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module Firefox
def expect_request(body: nil, endpoint: nil)
body = (body || {capabilities: {alwaysMatch: {acceptInsecureCerts: true,
browserName: 'firefox',
'moz:firefoxOptions': {prefs: {'remote.active-protocols' => 3}},
'moz:firefoxOptions': {},
'moz:debuggerAddress': true}}}).to_json
endpoint ||= "#{service_manager.uri}/session"
stub_request(:post, endpoint).with(body: body).to_return(valid_response)
Expand Down Expand Up @@ -79,10 +79,7 @@ def expect_request(body: nil, endpoint: nil)
opts = {args: ['-f']}
expect_request(body: {capabilities: {alwaysMatch: {acceptInsecureCerts: true,
browserName: 'firefox',
'moz:firefoxOptions': {
args: ['-f'],
prefs: {'remote.active-protocols' => 3}
},
'moz:firefoxOptions': opts,
'moz:debuggerAddress': true}}})
expect { described_class.new(options: Options.new(**opts)) }.not_to raise_exception
end
Expand Down
8 changes: 4 additions & 4 deletions rb/spec/unit/selenium/webdriver/firefox/options_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ module Firefox
options.add_preference('intl.accepted_languages', 'en-US')

prefs = options.as_json['moz:firefoxOptions']['prefs']
expected = {'intl.accepted_languages' => 'en-US', 'remote.active-protocols' => 3}
expected = {'intl.accepted_languages' => 'en-US'}
expect(prefs).to eq(expected)
end
end
Expand Down Expand Up @@ -185,7 +185,7 @@ module Firefox
it 'returns empty options by default' do
expect(options.as_json).to eq('browserName' => 'firefox',
'acceptInsecureCerts' => true,
'moz:firefoxOptions' => {'prefs' => {'remote.active-protocols' => 3}},
'moz:firefoxOptions' => {},
'moz:debuggerAddress' => true)
end

Expand All @@ -195,7 +195,7 @@ module Firefox
'browserName' => 'firefox',
'foo:bar' => {'foo' => 'bar'},
'moz:debuggerAddress' => true,
'moz:firefoxOptions' => {'prefs' => {'remote.active-protocols' => 3}})
'moz:firefoxOptions' => {})
end

it 'converts to a json hash' do
Expand Down Expand Up @@ -240,7 +240,7 @@ module Firefox
'moz:debuggerAddress' => true,
key => {'args' => %w[foo bar],
'binary' => '/foo/bar',
'prefs' => {'foo' => 'bar', 'remote.active-protocols' => 3},
'prefs' => {'foo' => 'bar'},
'env' => {'FOO' => 'bar'},
'profile' => 'encoded_profile',
'log' => {'level' => 'debug'},
Expand Down
Loading