tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 3f0a2a6e8d3e1c4ec735510da543739e63498615
parent dc24b8290977f4bc8186f6f4c21522e421287c02
Author: Benjamin VanderSloot <bvandersloot@mozilla.com>
Date:   Fri,  3 Oct 2025 14:04:57 +0000

Bug 1991970 - Add a few spare prefs to RecommendedPreferences.sys.mjs to disable features in automation - r=webdriver-reviewers,whimboo

I was poking around browser automation stuff further up the stack and
noticed a few prefs that look like they fit here. Should help keep rarer
browser UI elements stay out of the way and keep PBmode tests
consistent.

Differential Revision: https://phabricator.services.mozilla.com/D267047

Diffstat:
Mremote/shared/RecommendedPreferences.sys.mjs | 15+++++++++++++++
Mtesting/marionette/client/marionette_driver/geckoinstance.py | 11+++++++++++
2 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/remote/shared/RecommendedPreferences.sys.mjs b/remote/shared/RecommendedPreferences.sys.mjs @@ -108,6 +108,9 @@ const COMMON_PREFERENCES = new Map([ // This can be removed once Firefox 69 and 68 ESR and are no longer supported. ["browser.contentblocking.introCount", 99], + // Disable extension discovery + ["browser.discovery.enabled", false], + // Set global `dump` function to log strings to `stdout` for release builds as well. ["browser.dom.window.dump.enabled", true], @@ -195,6 +198,9 @@ const COMMON_PREFERENCES = new Map([ // Make sure Topsites doesn't hit the network to retrieve tiles from Contile. ["browser.topsites.contile.enabled", false], + // Disable translations + ["browser.translations.enable", false], + // Disable first run splash page on Windows 10 ["browser.usedOnWindows10.introURL", ""], @@ -269,6 +275,10 @@ const COMMON_PREFERENCES = new Map([ ["extensions.autoDisableScopes", 0], ["extensions.enabledScopes", 5], + // Disable form autofill for extensions and credit cards + ["extensions.formautofill.addresses.enabled", false], + ["extensions.formautofill.creditCards.enabled", false], + // Disable metadata caching for installed add-ons by default ["extensions.getAddons.cache.enabled", false], @@ -351,6 +361,7 @@ const COMMON_PREFERENCES = new Map([ // Privacy and Tracking Protection ["privacy.trackingprotection.enabled", false], + ["privacy.trackingprotection.pbmode.enabled", false], // Used to check if recommended preferences are applied ["remote.prefs.recommended.applied", true], @@ -378,6 +389,10 @@ const COMMON_PREFERENCES = new Map([ // passwords ["signon.autofillForms", false], + // Disable alerts for credential issues + ["signon.management.page.breach-alerts.enabled", false], + ["signon.management.page.vulnerable-passwords.enabled", false], + // Disable password capture, so that tests that include forms are not // influenced by the presence of the persistent doorhanger notification ["signon.rememberSignons", false], diff --git a/testing/marionette/client/marionette_driver/geckoinstance.py b/testing/marionette/client/marionette_driver/geckoinstance.py @@ -44,6 +44,8 @@ class GeckoInstance: # and causing false-positive test failures. See bug 1176798, bug 1177018, # bug 1210465. "apz.content_response_timeout": 60000, + # Disable extension discovery + "browser.discovery.enabled": False, # Make sure error page is not shown for blank pages with 4xx or 5xx response code "browser.http.blank_page_with_error_response.enabled": True, # Disable CFR features for automated tests. @@ -60,6 +62,8 @@ class GeckoInstance: "browser.region.network.url": "", # Don't pull Top Sites content from the network "browser.topsites.contile.enabled": False, + # Disable translations + "browser.translations.enable": False, # Disable UI tour "browser.uitour.enabled": False, # Disable captive portal @@ -100,6 +104,9 @@ class GeckoInstance: # AddonManager.SCOPE_PROFILE + AddonManager.SCOPE_APPLICATION "extensions.autoDisableScopes": 0, "extensions.enabledScopes": 5, + # Disable form autofill for extensions and credit cards + "extensions.formautofill.addresses.enabled": False, + "extensions.formautofill.creditCards.enabled": False, # Disable metadata caching for installed add-ons by default "extensions.getAddons.cache.enabled": False, # Disable intalling any distribution add-ons @@ -159,6 +166,7 @@ class GeckoInstance: "network.dns.native_https_query": False, # Privacy and Tracking Protection "privacy.trackingprotection.enabled": False, + "privacy.trackingprotection.pbmode.enabled": False, # Disable recommended automation prefs in CI "remote.prefs.recommended": False, # Don't do network connections for mitm priming @@ -174,6 +182,9 @@ class GeckoInstance: # Disable password capture, so that tests that include forms aren"t # influenced by the presence of the persistent doorhanger notification "signon.rememberSignons": False, + # Disable alerts for credential issues + "signon.management.page.breach-alerts.enabled": False, + "signon.management.page.vulnerable-passwords.enabled": False, # Prevent starting into safe mode after application crashes # Do not show TOU new user modal which can interfere with tests "termsofuse.bypassNotification": True,