tor-browser

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

commit c53a5da29248facf7f802f3f5173f85df1c4c4f4
parent fb07bfad4fb1011874e3135f87741862ae015d55
Author: kpatenio <kpatenio@mozilla.com>
Date:   Wed, 19 Nov 2025 21:19:26 +0000

Bug 2000728 — add pref to show/hide ipp exceptions in about:preferences. r=ip-protection-reviewers,mconley,fchasen

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

Diffstat:
Mbrowser/app/profile/firefox.js | 2++
Mbrowser/components/preferences/privacy.js | 13+++++++++++--
Mbrowser/components/preferences/tests/browser_privacy_ipprotection.js | 14+++++++++++---
3 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js @@ -3515,6 +3515,8 @@ pref("browser.ipProtection.userEnabled", false); pref("browser.ipProtection.variant", ""); // Pref to track number of times the VPN panel is opened pref("browser.ipProtection.panelOpenCount", 0); +// Pref to enable support for site exceptions +pref("browser.ipProtection.features.siteExceptions", false); pref("browser.ipProtection.exceptionsMode", "all"); pref("browser.ipProtection.domainExclusions", ""); pref("browser.ipProtection.domainInclusions", ""); diff --git a/browser/components/preferences/privacy.js b/browser/components/preferences/privacy.js @@ -201,6 +201,7 @@ Preferences.addAll([ // Firefox VPN { id: "browser.ipProtection.variant", type: "string" }, + { id: "browser.ipProtection.features.siteExceptions", type: "bool" }, { id: "browser.ipProtection.exceptionsMode", type: "string" }, { id: "browser.ipProtection.features.autoStart", type: "bool" }, { id: "browser.ipProtection.autoStartEnabled", type: "bool" }, @@ -1414,12 +1415,20 @@ Preferences.addSetting({ pref: "browser.ipProtection.variant", get: prefVal => prefVal == "beta", }); +Preferences.addSetting({ + id: "ipProtectionSiteExceptionsFeatureEnabled", + pref: "browser.ipProtection.features.siteExceptions", +}); // This setting also affects the radio group for site exceptions Preferences.addSetting({ id: "ipProtectionExceptionsMode", pref: "browser.ipProtection.exceptionsMode", - deps: ["ipProtectionVisible"], - visible: ({ ipProtectionVisible }) => ipProtectionVisible.value, + deps: ["ipProtectionVisible", "ipProtectionSiteExceptionsFeatureEnabled"], + visible: ({ + ipProtectionVisible, + ipProtectionSiteExceptionsFeatureEnabled, + }) => + ipProtectionVisible.value && ipProtectionSiteExceptionsFeatureEnabled.value, }); Preferences.addSetting({ id: "ipProtectionExceptionAllListButton", diff --git a/browser/components/preferences/tests/browser_privacy_ipprotection.js b/browser/components/preferences/tests/browser_privacy_ipprotection.js @@ -6,6 +6,8 @@ "use strict"; const FEATURE_PREF = "browser.ipProtection.variant"; +const SITE_EXCEPTIONS_FEATURE_PREF = + "browser.ipProtection.features.siteExceptions"; const MODE_PREF = "browser.ipProtection.exceptionsMode"; const AUTOSTART_FEATURE_ENABLED_PREF = "browser.ipProtection.features.autoStart"; @@ -16,6 +18,7 @@ const SECTION_ID = "dataIPProtectionGroup"; async function setupVpnPrefs({ feature, + siteExceptions = false, mode = "all", autostartFeatureEnabled = false, autostart = false, @@ -24,6 +27,7 @@ async function setupVpnPrefs({ return SpecialPowers.pushPrefEnv({ set: [ [FEATURE_PREF, feature], + [SITE_EXCEPTIONS_FEATURE_PREF, siteExceptions], [MODE_PREF, mode], [AUTOSTART_FEATURE_ENABLED_PREF, autostartFeatureEnabled], [AUTOSTART_PREF, autostart], @@ -66,7 +70,7 @@ add_task( // Test the site exceptions controls load correctly with mode set to "all" add_task(async function test_exceptions_load_with_all_mode() { - await setupVpnPrefs({ feature: "beta" }); + await setupVpnPrefs({ feature: "beta", siteExceptions: true }); await BrowserTestUtils.withNewTab( { gBrowser, url: "about:preferences#privacy" }, @@ -121,7 +125,11 @@ add_task(async function test_exceptions_load_with_all_mode() { // Test the site exceptions controls load correctly with mode set to "select" add_task(async function test_exceptions_with_select_mode() { - await setupVpnPrefs({ feature: "beta", mode: "select" }); + await setupVpnPrefs({ + feature: "beta", + siteExceptions: true, + mode: "select", + }); await BrowserTestUtils.withNewTab( { gBrowser, url: "about:preferences#privacy" }, @@ -176,7 +184,7 @@ add_task(async function test_exceptions_with_select_mode() { // Test the site exceptions controls and pref update correctly after selecting another mode option. add_task(async function test_exceptions_change_mode_and_buttons() { - await setupVpnPrefs({ feature: "beta" }); + await setupVpnPrefs({ feature: "beta", siteExceptions: true }); await BrowserTestUtils.withNewTab( { gBrowser, url: "about:preferences#privacy" },