tor-browser

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

commit 11cc2fb5d010f66c02da1badacf25ed745efb9cf
parent 174ee0b6ace49b7ea3b7098e95ecb3b1348aa4d7
Author: Benjamin VanderSloot <bvandersloot@mozilla.com>
Date:   Tue, 30 Dec 2025 15:32:56 +0000

Bug 2001194 - Implement "Additional Protections" card - r=emz,fluent-reviewers,credential-management-reviewers,akulyk,bolsson,mtigley

Using temporary strings

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

Diffstat:
Mbrowser/components/preferences/main.js | 29+++++++++++++++++++++++++++++
Mbrowser/components/preferences/privacy.inc.xhtml | 5+++--
Mbrowser/components/preferences/privacy.js | 55+++++++++++++++++++++++++++++++++++++++++++++++++++----
Mbrowser/components/preferences/tests/browser_privacy_gpc.js | 2++
Mbrowser/components/preferences/widgets/setting-group/setting-group.mjs | 1+
Mbrowser/locales-preview/privacyPreferences.ftl | 14++++++++++++++
Mtoolkit/components/passwordmgr/test/browser/browser_relay_signup_flow_showToAllBrowsers.js | 7+++++--
7 files changed, 105 insertions(+), 8 deletions(-)

diff --git a/browser/components/preferences/main.js b/browser/components/preferences/main.js @@ -2703,6 +2703,35 @@ SettingGroupManager.registerGroups({ }, ], }, + nonTechnicalPrivacy2: { + inProgress: true, + l10nId: "non-technical-privacy-heading", + headingLevel: 2, + items: [ + { + id: "gpcEnabled", + l10nId: "global-privacy-control-description", + supportPage: "global-privacy-control", + controlAttrs: { + "search-l10n-ids": "global-privacy-control-search", + }, + }, + { + id: "relayIntegration", + l10nId: "preferences-privacy-relay-available", + supportPage: "firefox-relay-integration", + }, + { + id: "dntRemoval", + l10nId: "do-not-track-removal3", + control: "moz-message-bar", + supportPage: "how-do-i-turn-do-not-track-feature", + controlAttrs: { + dismissable: true, + }, + }, + ], + }, securityPrivacyStatus: { inProgress: true, items: [ diff --git a/browser/components/preferences/privacy.inc.xhtml b/browser/components/preferences/privacy.inc.xhtml @@ -393,10 +393,11 @@ </vbox> </vbox> </groupbox> -<groupbox id="nonTechnicalPrivacyGroup" data-category="panePrivacy" hidden="true"> +<groupbox id="nonTechnicalPrivacyGroup" data-category="panePrivacy" hidden="true" data-srd-groupid="nonTechnicalPrivacy2"> <label id="nonTechnicalPrivacyHeader"><html:h2 data-l10n-id="non-technical-privacy-header" class="section-heading"/></label> - <html:setting-group groupid="nonTechnicalPrivacy"/> + <html:setting-group groupid="nonTechnicalPrivacy" /> </groupbox> +<html:setting-group groupid="nonTechnicalPrivacy2" data-category="panePrivacy" hidden="true"/> <!-- Firefox VPN - IP Protection --> <groupbox id="dataIPProtectionGroup" data-category="panePrivacy" hidden="true"> diff --git a/browser/components/preferences/privacy.js b/browser/components/preferences/privacy.js @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ +import { HeadlessShell } from "../shell/HeadlessShell.sys.mjs"; + /* import-globals-from extensionControlled.js */ /* import-globals-from preferences.js */ @@ -202,9 +204,11 @@ Preferences.addAll([ // Do not track and Global Privacy Control { id: "privacy.donottrackheader.enabled", type: "bool" }, { id: "privacy.globalprivacycontrol.functionality.enabled", type: "bool" }, - - // Global Privacy Control { id: "privacy.globalprivacycontrol.enabled", type: "bool" }, + { + id: "browser.preferences.config_warning.donottrackheader.dismissed", + type: "bool", + }, // Firefox VPN { id: "browser.ipProtection.enabled", type: "bool" }, @@ -1528,14 +1532,56 @@ Preferences.addSetting({ }, }); Preferences.addSetting({ + id: "relayFeature", + pref: "signon.firefoxRelay.feature", +}); +Preferences.addSetting({ + id: "relayIntegration", + deps: ["savePasswords", "relayFeature"], + visible: () => { + return FirefoxRelay.isAvailable; + }, + disabled: ({ savePasswords, relayFeature }) => { + return !savePasswords.value || relayFeature.pref.locked; + }, + get() { + return FirefoxRelay.isAvailable && !FirefoxRelay.isDisabled; + }, + set(checked) { + if (checked) { + FirefoxRelay.markAsAvailable(); + } else { + FirefoxRelay.markAsDisabled(); + } + }, + onUserChange(checked) { + if (checked) { + Glean.relayIntegration.enabledPrefChange.record(); + } else { + Glean.relayIntegration.disabledPrefChange.record(); + } + }, +}); +Preferences.addSetting({ id: "dntHeaderEnabled", pref: "privacy.donottrackheader.enabled", }); Preferences.addSetting({ id: "dntRemoval", + pref: "browser.preferences.config_warning.donottrackheader.dismissed", deps: ["dntHeaderEnabled"], - visible: ({ dntHeaderEnabled }) => { - return dntHeaderEnabled.value; + visible: ({ dntHeaderEnabled }, setting) => { + return dntHeaderEnabled.value && !setting.value; + }, + onUserClick: (event, _deps, setting) => { + let dismissButton = event.target?.shadowRoot?.querySelector(".close"); + if ( + dismissButton?.shadowRoot && + event.originalTarget && + dismissButton.shadowRoot.contains(event.originalTarget) + ) { + setting.value = true; + } }, }); @@ -3727,6 +3773,7 @@ var gPrivacyPane = { */ init() { initSettingGroup("nonTechnicalPrivacy"); + initSettingGroup("nonTechnicalPrivacy2"); initSettingGroup("securityPrivacyStatus"); initSettingGroup("securityPrivacyWarnings"); initSettingGroup("httpsOnly"); diff --git a/browser/components/preferences/tests/browser_privacy_gpc.js b/browser/components/preferences/tests/browser_privacy_gpc.js @@ -8,6 +8,7 @@ const FEATURE_PREF = "privacy.globalprivacycontrol.functionality.enabled"; const MODE_PREF = "privacy.globalprivacycontrol.enabled"; const DNT_PREF = "privacy.donottrackheader.enabled"; +const RELAY_PREF = "signon.firefoxRelay.feature"; const SECTION_ID = "nonTechnicalPrivacyGroup"; const GPC_CHECKBOX_ID = "gpcEnabled"; @@ -28,6 +29,7 @@ add_task(async function test_section_hidden_when_feature_flag_disabled() { set: [ [FEATURE_PREF, false], [MODE_PREF, false], + [RELAY_PREF, undefined], ], }); diff --git a/browser/components/preferences/widgets/setting-group/setting-group.mjs b/browser/components/preferences/widgets/setting-group/setting-group.mjs @@ -29,6 +29,7 @@ const CLICK_HANDLERS = new Set([ "moz-box-link", "moz-button", "moz-box-group", + "moz-message-bar", ]); /** diff --git a/browser/locales-preview/privacyPreferences.ftl b/browser/locales-preview/privacyPreferences.ftl @@ -314,3 +314,17 @@ preferences-etp-custom-suspect-fingerprinting-protection-enabled = preferences-etp-custom-suspect-fingerprinting-protection-enabled-context = .aria-label = { preferences-etp-custom-suspect-fingerprinting-protection-enabled.label } + +## Relay integration + +preferences-privacy-relay-available = + .label = Suggest { -relay-brand-name } email masks + .description = Hides your real email address to protect your inbox from spam. + +## Additional protections + +do-not-track-removal3 = + .message = We no longer support the “Do Not Track” feature + +non-technical-privacy-heading = + .label = Website Privacy Preferences diff --git a/toolkit/components/passwordmgr/test/browser/browser_relay_signup_flow_showToAllBrowsers.js b/toolkit/components/passwordmgr/test/browser/browser_relay_signup_flow_showToAllBrowsers.js @@ -17,7 +17,10 @@ registerCleanupFunction(() => { add_setup(async () => { await SpecialPowers.pushPrefEnv({ - set: [["signon.firefoxRelay.showToAllBrowsers", true]], + set: [ + ["signon.firefoxRelay.showToAllBrowsers", true], + ["browser.settings-redesign.nonTechnicalPrivacy2.enabled", true], + ], }); }); @@ -341,7 +344,7 @@ add_task( }, async _browser => { const relayIntegrationCheckbox = content.document.querySelector( - "checkbox#relayIntegration" + "moz-checkbox#relayIntegration" ); relayIntegrationCheckbox.click(); }