commit deef70bdaa869d5ab904b77abb5481692be58bb3
parent ac500ea570dbad10924a4d8ccf47c61c17e7c442
Author: Benjamin VanderSloot <bvandersloot@mozilla.com>
Date: Mon, 22 Dec 2025 20:46:57 +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:
7 files changed, 103 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: {
items: [
{
diff --git a/browser/components/preferences/privacy.inc.xhtml b/browser/components/preferences/privacy.inc.xhtml
@@ -391,10 +391,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
@@ -195,9 +195,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" },
@@ -1524,14 +1526,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;
+ }
},
});
@@ -3723,6 +3767,7 @@ var gPrivacyPane = {
*/
init() {
initSettingGroup("nonTechnicalPrivacy");
+ initSettingGroup("nonTechnicalPrivacy2");
if (Services.prefs.getBoolPref("privacy.ui.status_card", false)) {
initSettingGroup("securityPrivacyStatus");
}
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
@@ -309,3 +309,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();
}