tor-browser

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

commit d40171fecba571276e4deed199e8f7289fa72f41
parent d803e2122dd20346cae076c543216e7d43a0ef0d
Author: Magnus Melin <mkmelin+mozilla@iki.fi>
Date:   Thu, 23 Oct 2025 06:14:41 +0000

Bug 1995649 - Move some uri fixup prefs to all.js, adjust test_URIFixup_info.js to pass. r=Gijs

With browser.fixup.domainwhitelist.localhost true, the test will fail.
It's not noticed for Firefox due to bug 1168178.

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

Diffstat:
Mbrowser/app/profile/firefox.js | 20--------------------
Mdocshell/test/unit/test_URIFixup_info.js | 2++
Mmobile/android/app/geckoview-prefs.js | 2--
Mmodules/libpref/init/all.js | 20++++++++++++++++++++
4 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js @@ -244,26 +244,6 @@ pref("browser.uitour.url", "https://www.mozilla.org/%LOCALE%/firefox/%VERSION%/t // How long to show a Hearbeat survey (two hours, in seconds) pref("browser.uitour.surveyDuration", 7200); -pref("keyword.enabled", true); - -// Fixup whitelists, the urlbar won't try to search for these words, but will -// instead consider them valid TLDs. Don't check these directly, use -// Services.uriFixup.isDomainKnown() instead. -pref("browser.fixup.domainwhitelist.localhost", true); -// https://tools.ietf.org/html/rfc2606 -pref("browser.fixup.domainsuffixwhitelist.test", true); -pref("browser.fixup.domainsuffixwhitelist.example", true); -pref("browser.fixup.domainsuffixwhitelist.invalid", true); -pref("browser.fixup.domainsuffixwhitelist.localhost", true); -// https://tools.ietf.org/html/draft-wkumari-dnsop-internal-00 -pref("browser.fixup.domainsuffixwhitelist.internal", true); -// https://tools.ietf.org/html/rfc6762 -pref("browser.fixup.domainsuffixwhitelist.local", true); - -// Whether to always go through the DNS server before sending a single word -// search string, that may contain a valid host, to a search engine. -pref("browser.fixup.dns_first_for_single_words", false); - #ifdef UNIX_BUT_NOT_MAC pref("general.autoScroll", false); #else diff --git a/docshell/test/unit/test_URIFixup_info.js b/docshell/test/unit/test_URIFixup_info.js @@ -990,6 +990,8 @@ function sanitize(input) { } add_task(async function setup() { + // FIXME: the test fails without setting this to false. Bug 1995919. + Services.prefs.setBoolPref("browser.fixup.domainwhitelist.localhost", false); var prefList = [ "browser.fixup.typo.scheme", "keyword.enabled", diff --git a/mobile/android/app/geckoview-prefs.js b/mobile/android/app/geckoview-prefs.js @@ -269,8 +269,6 @@ pref("image.cache.size", 1048576); // bytes // Inherit locale from the OS, used for multi-locale builds pref("intl.locale.requested", ""); -pref("keyword.enabled", true); - // Always tilt the caret to match the text selection guideline (bug 1097398) pref("layout.accessiblecaret.always_tilt", true); diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js @@ -1025,6 +1025,26 @@ pref("javascript.options.dump_stack_on_debuggee_would_run", false); // advanced prefs pref("image.animation_mode", "normal"); +pref("keyword.enabled", true); + +// Fixup whitelists, the urlbar won't try to search for these words, but will +// instead consider them valid TLDs. Don't check these directly, use +// Services.uriFixup.isDomainKnown() instead. +pref("browser.fixup.domainwhitelist.localhost", true); +// https://tools.ietf.org/html/rfc2606 +pref("browser.fixup.domainsuffixwhitelist.test", true); +pref("browser.fixup.domainsuffixwhitelist.example", true); +pref("browser.fixup.domainsuffixwhitelist.invalid", true); +pref("browser.fixup.domainsuffixwhitelist.localhost", true); +// https://tools.ietf.org/html/draft-wkumari-dnsop-internal-00 +pref("browser.fixup.domainsuffixwhitelist.internal", true); +// https://tools.ietf.org/html/rfc6762 +pref("browser.fixup.domainsuffixwhitelist.local", true); + +// Whether to always go through the DNS server before sending a single word +// search string, that may contain a valid host, to a search engine. +pref("browser.fixup.dns_first_for_single_words", false); + // If there is ever a security firedrill that requires // us to block certian ports global, this is the pref // to use. Is is a comma delimited list of port numbers