commit 4b31972c1d85ca50b54221b479643b73f2c54c4d parent 2a3733e687c669cf9e1555a3ed2f98ee81930af9 Author: Cristina Horotan <chorotan@mozilla.com> Date: Mon, 22 Dec 2025 23:30:30 +0200 Revert "Bug 2001196, Bug 2001194 - Implement "History" card - r=emz,fluent-reviewers,akulyk,bolsson" for causing bc failures on siteData/browser.toml This reverts commit f52055643f402a739ac3649b90949aaf288711d9. Revert "Bug 2001195 - Implement Browsing data card - r=emz,fluent-reviewers,akulyk,bolsson" This reverts commit 369d1019f57689030bb0702f10e0137972e9612f. Revert "Bug 2001194 - Implement "Additional Protections" card - r=emz,fluent-reviewers,credential-management-reviewers,akulyk,bolsson,mtigley" This reverts commit deef70bdaa869d5ab904b77abb5481692be58bb3. Diffstat:
21 files changed, 142 insertions(+), 910 deletions(-)
diff --git a/browser/base/content/test/sanitize/browser_sanitizeDialog_v2.js b/browser/base/content/test/sanitize/browser_sanitizeDialog_v2.js @@ -301,30 +301,26 @@ add_task(async function test_pref_remembering() { dh.open(); await dh.promiseClosed; - if (!settingsRedesignHistoryEnabled()) { - // test rememebering prefs from the clear history context - // since clear history and clear site data have seperate remembering - // of prefs - dh = new ClearHistoryDialogHelper({ mode: "clearHistory" }); - dh.onload = function () { - this.checkPrefCheckbox("cookiesAndStorage", true); - this.checkPrefCheckbox("siteSettings", false); - this.checkPrefCheckbox("cache", false); - - this.acceptDialog(); - }; - dh.open(); - await dh.promiseClosed; - } + // test rememebering prefs from the clear history context + // since clear history and clear site data have seperate remembering + // of prefs + dh = new ClearHistoryDialogHelper({ mode: "clearHistory" }); + dh.onload = function () { + this.checkPrefCheckbox("cookiesAndStorage", true); + this.checkPrefCheckbox("siteSettings", false); + this.checkPrefCheckbox("cache", false); + + this.acceptDialog(); + }; + dh.open(); + await dh.promiseClosed; // validate if prefs are remembered across both clear history and browser dh = new ClearHistoryDialogHelper({ mode: "browser" }); dh.onload = function () { this.validateCheckbox("cookiesAndStorage", true); this.validateCheckbox("siteSettings", false); - if (!settingsRedesignHistoryEnabled()) { - this.validateCheckbox("cache", false); - } + this.validateCheckbox("cache", false); this.cancelDialog(); }; @@ -771,113 +767,111 @@ add_task(async function test_clear_on_shutdown() { await SiteDataTestUtils.clear(); }); -if (!settingsRedesignHistoryEnabled()) { - add_task(async function testClearHistoryCheckboxStatesAfterMigration() { - await SpecialPowers.pushPrefEnv({ - set: [ - ["privacy.cpd.history", false], - ["privacy.cpd.formdata", true], - ["privacy.cpd.cookies", true], - ["privacy.cpd.offlineApps", false], - ["privacy.cpd.sessions", false], - ["privacy.cpd.siteSettings", false], - ["privacy.cpd.cache", true], - // Set cookiesAndStorage to verify that the pref is flipped in the test - ["privacy.clearHistory.cookiesAndStorage", false], - // We set the old migrate pref to false to simulate a user who has not migrated to the new dialog. - // we should follow the user's old prefs with "cpd." prefix in this case. - ["privacy.sanitize.cpd.hasMigratedToNewPrefs2", false], - ["privacy.sanitize.cpd.hasMigratedToNewPrefs3", false], - ], - }); - - let dh = new ClearHistoryDialogHelper({ mode: "clearHistory" }); - dh.onload = function () { - this.validateCheckbox("cookiesAndStorage", true); - this.validateCheckbox("browsingHistoryAndDownloads", false); - this.validateCheckbox("formdata", true); - this.validateCheckbox("cache", true); - this.validateCheckbox("siteSettings", false); - - this.checkPrefCheckbox("siteSettings", true); - this.checkPrefCheckbox("cookiesAndStorage", false); - this.acceptDialog(); - }; - dh.open(); - await dh.promiseClosed; +add_task(async function testClearHistoryCheckboxStatesAfterMigration() { + await SpecialPowers.pushPrefEnv({ + set: [ + ["privacy.cpd.history", false], + ["privacy.cpd.formdata", true], + ["privacy.cpd.cookies", true], + ["privacy.cpd.offlineApps", false], + ["privacy.cpd.sessions", false], + ["privacy.cpd.siteSettings", false], + ["privacy.cpd.cache", true], + // Set cookiesAndStorage to verify that the pref is flipped in the test + ["privacy.clearHistory.cookiesAndStorage", false], + // We set the old migrate pref to false to simulate a user who has not migrated to the new dialog. + // we should follow the user's old prefs with "cpd." prefix in this case. + ["privacy.sanitize.cpd.hasMigratedToNewPrefs2", false], + ["privacy.sanitize.cpd.hasMigratedToNewPrefs3", false], + ], + }); - is( - Services.prefs.getBoolPref("privacy.sanitize.cpd.hasMigratedToNewPrefs3"), - true, - "Migration is complete for cpd branch" - ); + let dh = new ClearHistoryDialogHelper({ mode: "clearHistory" }); + dh.onload = function () { + this.validateCheckbox("cookiesAndStorage", true); + this.validateCheckbox("browsingHistoryAndDownloads", false); + this.validateCheckbox("formdata", true); + this.validateCheckbox("cache", true); + this.validateCheckbox("siteSettings", false); - // make sure the migration doesn't run again - dh = new ClearHistoryDialogHelper({ mode: "clearHistory" }); - dh.onload = function () { - this.validateCheckbox("siteSettings", true); - this.validateCheckbox("cookiesAndStorage", false); - this.cancelDialog(); - }; - dh.open(); - await dh.promiseClosed; - }); + this.checkPrefCheckbox("siteSettings", true); + this.checkPrefCheckbox("cookiesAndStorage", false); + this.acceptDialog(); + }; + dh.open(); + await dh.promiseClosed; - add_task(async function testClearHistoryCheckboxStatesAfterMigration3() { - await SpecialPowers.pushPrefEnv({ - set: [ - ["privacy.cpd.history", false], - ["privacy.cpd.formdata", true], - ["privacy.cpd.cookies", true], - ["privacy.cpd.offlineApps", false], - ["privacy.cpd.sessions", false], - ["privacy.cpd.siteSettings", true], - ["privacy.cpd.cache", true], - // Verify that prefs not in not touched in migration from v2 - ["privacy.clearHistory.cookiesAndStorage", false], - ["privacy.clearHistory.siteSettings", false], - ["privacy.clearHistory.cache", false], - // Verify that formData and browsingHistoryAndDownloads inherit this value - ["privacy.clearHistory.historyFormDataAndDownloads", true], - // migrate from v2 to v3, dont redo the v1 to v2 migration - ["privacy.sanitize.cpd.hasMigratedToNewPrefs2", true], - ["privacy.sanitize.cpd.hasMigratedToNewPrefs3", false], - ], - }); - - let dh = new ClearHistoryDialogHelper({ mode: "clearHistory" }); - dh.onload = function () { - // migration to v3 shouldn't modify these values - this.validateCheckbox("cookiesAndStorage", false); - this.validateCheckbox("siteSettings", false); - this.validateCheckbox("cache", false); - - // migration to v3 should set them initially to true from historyFormDataAndDownloads pref - this.validateCheckbox("browsingHistoryAndDownloads", true); - this.validateCheckbox("formdata", true); - - // flip two prefs to open to verify migration doesn't happen again and checkboxes retain their value - this.checkPrefCheckbox("siteSettings", true); - this.checkPrefCheckbox("browsingHistoryAndDownloads", false); - this.acceptDialog(); - }; - dh.open(); - await dh.promiseClosed; + is( + Services.prefs.getBoolPref("privacy.sanitize.cpd.hasMigratedToNewPrefs3"), + true, + "Migration is complete for cpd branch" + ); - is( - Services.prefs.getBoolPref("privacy.sanitize.cpd.hasMigratedToNewPrefs3"), - true, - "Migration is complete for cpd branch" - ); + // make sure the migration doesn't run again + dh = new ClearHistoryDialogHelper({ mode: "clearHistory" }); + dh.onload = function () { + this.validateCheckbox("siteSettings", true); + this.validateCheckbox("cookiesAndStorage", false); + this.cancelDialog(); + }; + dh.open(); + await dh.promiseClosed; +}); - // make sure the migration doesn't run again - dh = new ClearHistoryDialogHelper({ mode: "clearHistory" }); - dh.onload = function () { - this.validateCheckbox("siteSettings", true); - this.validateCheckbox("browsingHistoryAndDownloads", false); - this.cancelDialog(); - }; - dh.open(); - await dh.promiseClosed; +add_task(async function testClearHistoryCheckboxStatesAfterMigration3() { + await SpecialPowers.pushPrefEnv({ + set: [ + ["privacy.cpd.history", false], + ["privacy.cpd.formdata", true], + ["privacy.cpd.cookies", true], + ["privacy.cpd.offlineApps", false], + ["privacy.cpd.sessions", false], + ["privacy.cpd.siteSettings", true], + ["privacy.cpd.cache", true], + // Verify that prefs not in not touched in migration from v2 + ["privacy.clearHistory.cookiesAndStorage", false], + ["privacy.clearHistory.siteSettings", false], + ["privacy.clearHistory.cache", false], + // Verify that formData and browsingHistoryAndDownloads inherit this value + ["privacy.clearHistory.historyFormDataAndDownloads", true], + // migrate from v2 to v3, dont redo the v1 to v2 migration + ["privacy.sanitize.cpd.hasMigratedToNewPrefs2", true], + ["privacy.sanitize.cpd.hasMigratedToNewPrefs3", false], + ], }); -} + + let dh = new ClearHistoryDialogHelper({ mode: "clearHistory" }); + dh.onload = function () { + // migration to v3 shouldn't modify these values + this.validateCheckbox("cookiesAndStorage", false); + this.validateCheckbox("siteSettings", false); + this.validateCheckbox("cache", false); + + // migration to v3 should set them initially to true from historyFormDataAndDownloads pref + this.validateCheckbox("browsingHistoryAndDownloads", true); + this.validateCheckbox("formdata", true); + + // flip two prefs to open to verify migration doesn't happen again and checkboxes retain their value + this.checkPrefCheckbox("siteSettings", true); + this.checkPrefCheckbox("browsingHistoryAndDownloads", false); + this.acceptDialog(); + }; + dh.open(); + await dh.promiseClosed; + + is( + Services.prefs.getBoolPref("privacy.sanitize.cpd.hasMigratedToNewPrefs3"), + true, + "Migration is complete for cpd branch" + ); + + // make sure the migration doesn't run again + dh = new ClearHistoryDialogHelper({ mode: "clearHistory" }); + dh.onload = function () { + this.validateCheckbox("siteSettings", true); + this.validateCheckbox("browsingHistoryAndDownloads", false); + this.cancelDialog(); + }; + dh.open(); + await dh.promiseClosed; +}); diff --git a/browser/base/content/test/sanitize/head.js b/browser/base/content/test/sanitize/head.js @@ -499,15 +499,6 @@ function promiseSanitizationComplete() { return TestUtils.topicObserved("sanitizer-sanitization-complete"); } -function settingsRedesignHistoryEnabled() { - return ( - Services.prefs.getBoolPref( - "browser.settings-redesign.history2.enabled", - false - ) || Services.prefs.getBoolPref("browser.settings-redesign.enabled", false) - ); -} - /** * This wraps the dialog and provides some convenience methods for interacting * with it. @@ -660,15 +651,9 @@ ClearHistoryDialogHelper.prototype = { // We want to simulate opening the dialog inside preferences for clear history // and clear site data if (this._mode != "browser") { - if (this._mode == "clearOnShutdown" && settingsRedesignHistoryEnabled()) { - await openPreferencesViaOpenPreferencesAPI("history", { - leaveOpen: true, - }); - } else { - await openPreferencesViaOpenPreferencesAPI("privacy", { - leaveOpen: true, - }); - } + await openPreferencesViaOpenPreferencesAPI("privacy", { + leaveOpen: true, + }); let tabWindow = gBrowser.selectedBrowser.contentWindow; let clearDialogOpenButtonId = this._mode + "Button"; // the id for clear on shutdown is of a different format diff --git a/browser/components/enterprisepolicies/tests/browser/browser.toml b/browser/components/enterprisepolicies/tests/browser/browser.toml @@ -115,9 +115,6 @@ https_first_disabled = true ["browser_policy_privatebrowsingmodeavailability.js"] -["browser_policy_privatebrowsingmodeavailability_srd.js"] -prefs = ["browser.settings-redesign.history2.enabled=true"] - ["browser_policy_search_engine.js"] skip-if = [ "os == 'win' && os_version == '11.26100' && arch == 'x86_64' && opt && verify-standalone", diff --git a/browser/components/enterprisepolicies/tests/browser/browser_policy_privatebrowsingmodeavailability_srd.js b/browser/components/enterprisepolicies/tests/browser/browser_policy_privatebrowsingmodeavailability_srd.js @@ -1,61 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ - -"use strict"; - -add_task(async function test_privatebrowsing_disabled() { - await setupPolicyEngineWithJson({ - policies: { - PrivateBrowsingModeAvailability: 1, - }, - }); - is( - PrivateBrowsingUtils.enabled, - false, - "Private browsing should be disabled" - ); - let newWin = await BrowserTestUtils.openNewBrowserWindow(); - let privateBrowsingCommand = newWin.document.getElementById( - "Tools:PrivateBrowsing" - ); - is( - privateBrowsingCommand.hidden, - true, - "The private browsing command should be hidden" - ); - await BrowserTestUtils.withNewTab( - "about:preferences#privacy", - async browser => { - ok( - browser.contentDocument - .getElementById("historyMode") - .querySelector("moz-option[value='dontremember']").disabled, - "Don't remember history should be disabled" - ); - } - ); - await BrowserTestUtils.closeWindow(newWin); - - await testPageBlockedByPolicy("about:privatebrowsing"); -}); - -add_task(async function test_privatebrowsing_enabled() { - await setupPolicyEngineWithJson({ - policies: { - PrivateBrowsingModeAvailability: 2, - }, - }); - - is(PrivateBrowsingUtils.enabled, true, "Private browsing should be true"); - let newWin = await BrowserTestUtils.openNewBrowserWindow(); - await BrowserTestUtils.withNewTab( - "about:preferences#privacy", - async browser => { - ok( - browser.contentDocument.getElementById("historyMode").disabled, - "History selector should be disabled" - ); - } - ); - await BrowserTestUtils.closeWindow(newWin); -}); diff --git a/browser/components/preferences/main.js b/browser/components/preferences/main.js @@ -2703,35 +2703,6 @@ 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: [ { @@ -2920,74 +2891,6 @@ SettingGroupManager.registerGroups({ }, ], }, - cookiesAndSiteData2: { - inProgress: true, - l10nId: "sitedata-heading", - headingLevel: 2, - items: [ - { - id: "siteDataSize", - l10nId: "sitedata-total-size-calculating", - control: "moz-box-item", - supportPage: "sitedata-learn-more", - }, - { - id: "manageDataSettingsGroup", - control: "moz-box-group", - controlAttrs: { - type: "default", - }, - items: [ - { - id: "clearSiteDataButton", - l10nId: "sitedata-clear2", - control: "moz-box-button", - iconSrc: "chrome://browser/skin/flame.svg", - controlAttrs: { - "search-l10n-ids": ` - clear-site-data-cookies-empty.label, - clear-site-data-cache-empty.label - `, - }, - }, - { - id: "siteDataSettings", - l10nId: "sitedata-settings3", - control: "moz-box-button", - controlAttrs: { - "search-l10n-ids": ` - site-data-settings-window.title, - site-data-column-host.label, - site-data-column-cookies.label, - site-data-column-storage.label, - site-data-settings-description, - site-data-remove-all.label, - `, - }, - }, - { - id: "cookieExceptions", - l10nId: "sitedata-cookies-exceptions3", - control: "moz-box-button", - controlAttrs: { - "search-l10n-ids": ` - permissions-address, - permissions-block.label, - permissions-allow.label, - permissions-remove.label, - permissions-remove-all.label, - permissions-exceptions-cookie-desc - `, - }, - }, - ], - }, - { - id: "deleteOnClose", - l10nId: "sitedata-delete-on-close", - }, - ], - }, networkProxy: { items: [ { @@ -3180,93 +3083,6 @@ SettingGroupManager.registerGroups({ }, ], }, - history2: { - inProgress: true, - l10nId: "history-section-header", - items: [ - { - id: "deleteOnCloseInfo", - l10nId: "sitedata-delete-on-close-private-browsing3", - control: "moz-message-bar", - }, - { - id: "historyMode", - control: "moz-radio-group", - options: [ - { - value: "remember", - l10nId: "history-remember-option-all", - }, - { value: "dontremember", l10nId: "history-remember-option-never" }, - { - value: "custom", - l10nId: "history-remember-option-custom", - items: [ - { - id: "customHistoryButton", - control: "moz-box-button", - l10nId: "history-custom-button", - }, - ], - }, - ], - controlAttrs: { - "search-l10n-ids": ` - history-remember-description3, - history-dontremember-description3, - history-private-browsing-permanent.label, - history-remember-browser-option.label, - history-remember-search-option.label, - history-clear-on-close-option.label, - history-clear-on-close-settings.label - `, - }, - }, - ], - }, - historyAdvanced: { - l10nId: "history-custom-section-header", - headingLevel: 2, - items: [ - { - id: "privateBrowsingAutoStart", - l10nId: "history-private-browsing-permanent", - }, - { - id: "rememberHistory", - l10nId: "history-remember-browser-option", - }, - { - id: "rememberForms", - l10nId: "history-remember-search-option", - }, - { - id: "alwaysClear", - l10nId: "history-clear-on-close-option", - items: [ - { - id: "clearDataSettings", - l10nId: "history-clear-on-close-settings", - control: "moz-box-button", - controlAttrs: { - "search-l10n-ids": ` - clear-data-settings-label, - history-section-label, - item-history-and-downloads.label, - item-cookies.label, - item-active-logins.label, - item-cache.label, - item-form-search-history.label, - data-section-label, - item-site-settings.label, - item-offline-apps.label - `, - }, - }, - ], - }, - ], - }, permissions: { id: "permissions", l10nId: "permissions-header2", diff --git a/browser/components/preferences/preferences.js b/browser/components/preferences/preferences.js @@ -287,11 +287,6 @@ const CONFIG_PANES = Object.freeze({ module: "chrome://browser/content/preferences/config/aiFeatures.mjs", visible: () => srdSectionEnabled("aiFeatures"), }, - history: { - parent: "privacy", - l10nId: "history-header2", - groupIds: ["historyAdvanced"], - }, }); var gLastCategory = { category: undefined, subcategory: undefined }; diff --git a/browser/components/preferences/privacy.inc.xhtml b/browser/components/preferences/privacy.inc.xhtml @@ -391,11 +391,10 @@ </vbox> </vbox> </groupbox> -<groupbox id="nonTechnicalPrivacyGroup" data-category="panePrivacy" hidden="true" data-srd-groupid="nonTechnicalPrivacy2"> +<groupbox id="nonTechnicalPrivacyGroup" data-category="panePrivacy" hidden="true"> <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"> @@ -403,11 +402,10 @@ </groupbox> -<groupbox id="siteDataGroup" data-category="panePrivacy" hidden="true" aria-describedby="totalSiteDataSize" data-srd-groupid="cookiesAndSiteData2"> +<groupbox id="siteDataGroup" data-category="panePrivacy" hidden="true" aria-describedby="totalSiteDataSize"> <label><html:h2 data-l10n-id="sitedata-header"/></label> <html:setting-group groupid="cookiesAndSiteData"/> </groupbox> -<html:setting-group groupid="cookiesAndSiteData2" data-category="panePrivacy" hidden="true" /> <!-- Cookie Banner Handling --> <groupbox id="cookieBannerHandlingGroup" data-category="panePrivacy" data-subcategory="cookiebanner" hidden="true"> @@ -575,11 +573,10 @@ </groupbox> <!-- History --> -<groupbox id="historyGroup" data-category="panePrivacy" hidden="true" aria-describedby="totalSiteDataSize" data-srd-groupid="history2"> +<groupbox id="historyGroup" data-category="panePrivacy" hidden="true" aria-describedby="totalSiteDataSize"> <label><html:h2 data-l10n-id="history-header"/></label> <html:setting-group groupid="history"/> </groupbox> -<html:setting-group groupid="history2" data-category="panePrivacy" hidden="true"/> <hbox id="permissionsCategory" class="subcategory" diff --git a/browser/components/preferences/privacy.js b/browser/components/preferences/privacy.js @@ -195,11 +195,9 @@ 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" }, @@ -1526,56 +1524,14 @@ 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 }, 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; - } + visible: ({ dntHeaderEnabled }) => { + return dntHeaderEnabled.value; }, }); @@ -2172,15 +2128,13 @@ Preferences.addSetting({ return privateBrowsingAutoStart.locked && privateBrowsingAutoStart.value; }, getControlConfig(config, { privateBrowsingAutoStart }, setting) { - let l10nId = undefined; - if (!srdSectionEnabled("history2")) { - if (setting.value == "remember") { - l10nId = "history-remember-description3"; - } else if (setting.value == "dontremember") { - l10nId = "history-dontremember-description3"; - } else if (setting.value == "custom") { - l10nId = "history-custom-description3"; - } + let l10nId = null; + if (setting.value == "remember") { + l10nId = "history-remember-description3"; + } else if (setting.value == "dontremember") { + l10nId = "history-dontremember-description3"; + } else if (setting.value == "custom") { + l10nId = "history-custom-description3"; } let dontRememberOption = config.options.find( @@ -2203,14 +2157,6 @@ Preferences.addSetting({ }); Preferences.addSetting({ - id: "customHistoryButton", - onUserClick(e) { - e.preventDefault(); - gotoPref("paneHistory"); - }, -}); - -Preferences.addSetting({ id: "privateBrowsingAutoStart", pref: "browser.privatebrowsing.autostart", deps: ["historyMode"], @@ -3777,18 +3723,15 @@ var gPrivacyPane = { */ init() { initSettingGroup("nonTechnicalPrivacy"); - initSettingGroup("nonTechnicalPrivacy2"); if (Services.prefs.getBoolPref("privacy.ui.status_card", false)) { initSettingGroup("securityPrivacyStatus"); } initSettingGroup("httpsOnly"); initSettingGroup("browsingProtection"); initSettingGroup("cookiesAndSiteData"); - initSettingGroup("cookiesAndSiteData2"); initSettingGroup("certificates"); initSettingGroup("ipprotection"); initSettingGroup("history"); - initSettingGroup("history2"); initSettingGroup("permissions"); initSettingGroup("dnsOverHttps"); initSettingGroup("dnsOverHttpsAdvanced"); diff --git a/browser/components/preferences/tests/browser.toml b/browser/components/preferences/tests/browser.toml @@ -254,21 +254,11 @@ skip-if = [ "os == 'linux' && os_version == '24.04' && arch == 'x86_64' && display == 'x11' && a11y_checks && opt", ] -["browser_privacypane_2_srd.js"] -skip-if = [ - "os == 'linux' && os_version == '24.04' && arch == 'x86_64' && display == 'x11' && a11y_checks && opt", -] - ["browser_privacypane_3.js"] skip-if = [ "os == 'linux' && os_version == '24.04' && arch == 'x86_64' && display == 'x11' && a11y_checks && opt", ] -["browser_privacypane_3_srd.js"] -skip-if = [ - "os == 'linux' && os_version == '24.04' && arch == 'x86_64' && display == 'x11' && a11y_checks && opt", -] - ["browser_proxy_backup.js"] ["browser_sanitizeOnShutdown_prefLocked.js"] @@ -381,8 +371,6 @@ support-files = [ ["browser_warning_permanent_private_browsing.js"] -["browser_warning_permanent_private_browsing_srd.js"] - ["browser_windows_launch_on_login.js"] run-if = [ "os == 'win' && !msix", diff --git a/browser/components/preferences/tests/browser_privacy_gpc.js b/browser/components/preferences/tests/browser_privacy_gpc.js @@ -8,7 +8,6 @@ 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"; @@ -29,7 +28,6 @@ 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/tests/browser_privacypane_2_srd.js b/browser/components/preferences/tests/browser_privacypane_2_srd.js @@ -1,19 +0,0 @@ -let rootDir = getRootDirectory(gTestPath); -let jar = getJar(rootDir); -if (jar) { - let tmpdir = extractJarToTmp(jar); - rootDir = "file://" + tmpdir.path + "/"; -} -/* import-globals-from privacypane_tests_perwindow.js */ -Services.scriptloader.loadSubScript( - rootDir + "privacypane_tests_perwindow.js", - this -); - -add_setup(async function () { - await SpecialPowers.pushPrefEnv({ - set: [["browser.settings-redesign.history2.enabled", "true"]], - }); -}); - -run_test_subset([test_dependent_elements_redesigned]); diff --git a/browser/components/preferences/tests/browser_privacypane_3_srd.js b/browser/components/preferences/tests/browser_privacypane_3_srd.js @@ -1,27 +0,0 @@ -let rootDir = getRootDirectory(gTestPath); -let jar = getJar(rootDir); -if (jar) { - let tmpdir = extractJarToTmp(jar); - rootDir = "file://" + tmpdir.path + "/"; -} -/* import-globals-from privacypane_tests_perwindow.js */ -Services.scriptloader.loadSubScript( - rootDir + "privacypane_tests_perwindow.js", - this -); - -add_setup(async function () { - await SpecialPowers.pushPrefEnv({ - set: [["browser.settings-redesign.history2.enabled", "true"]], - }); -}); - -run_test_subset([ - test_custom_retention_redesign("rememberHistory", "remember"), - test_custom_retention_redesign("rememberHistory", "custom"), - test_custom_retention_redesign("rememberForms", "custom"), - test_custom_retention_redesign("rememberForms", "custom"), - test_historymode_retention_redesign("remember", "custom"), - test_custom_retention_redesign("alwaysClear", "remember"), - test_custom_retention_redesign("alwaysClear", "custom"), -]); diff --git a/browser/components/preferences/tests/browser_warning_permanent_private_browsing.js b/browser/components/preferences/tests/browser_warning_permanent_private_browsing.js @@ -29,31 +29,11 @@ function checkForPrompt(prefVal) { promptFired = true; return doc.defaultView.CONFIRM_RESTART_PROMPT_RESTART_NOW; }; - // Tick the checkbox and pretend the user did it: - let checkbox = gBrowser.contentWindow.document.querySelector( - "setting-group[groupid='history'] #privateBrowsingAutoStart" - ); - - ok(checkbox, "the privateBrowsingAutoStart checkbox should exist"); - is_element_visible( - checkbox, - "the privateBrowsingAutoStart checkbox should be visible" - ); - - // No need to click if we're already in the desired state. - if (checkbox.checked === prefVal) { - return; - } - - // Scroll into view for click to succeed. - checkbox.scrollIntoView(); - - // Toggle the state. - await EventUtils.synthesizeMouseAtCenter( - checkbox, - {}, - checkbox.ownerGlobal + await updateCheckBox( + gBrowser.contentWindow, + "privateBrowsingAutoStart", + prefVal ); // Now the prompt should have shown. diff --git a/browser/components/preferences/tests/browser_warning_permanent_private_browsing_srd.js b/browser/components/preferences/tests/browser_warning_permanent_private_browsing_srd.js @@ -1,75 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ - -"use strict"; - -function checkForPrompt(prefVal) { - return async function () { - await SpecialPowers.pushPrefEnv({ - set: [ - ["privacy.history.custom", true], - ["browser.privatebrowsing.autostart", !prefVal], - ["browser.settings-redesign.history2.enabled", true], - ], - }); - - await openPreferencesViaOpenPreferencesAPI("paneHistory", { - leaveOpen: true, - }); - let doc = gBrowser.contentDocument; - - // Stub out the prompt method as an easy way to check it was shown. We throw away - // the tab straight after so don't need to bother restoring it. - let promptFired = false; - doc.defaultView.confirmRestartPrompt = () => { - promptFired = true; - return doc.defaultView.CONFIRM_RESTART_PROMPT_RESTART_NOW; - }; - // Tick the checkbox and pretend the user did it: - let checkbox = gBrowser.contentWindow.document.querySelector( - "setting-group[groupid='historyAdvanced'] #privateBrowsingAutoStart" - ); - - ok(checkbox, "the privateBrowsingAutoStart checkbox should exist"); - is_element_visible( - checkbox, - "the privateBrowsingAutoStart checkbox should be visible" - ); - - // No need to click if we're already in the desired state. - if (checkbox.checked === prefVal) { - return; - } - - // Scroll into view for click to succeed. - checkbox.scrollIntoView(); - - // Toggle the state. - await EventUtils.synthesizeMouseAtCenter( - checkbox, - {}, - checkbox.ownerGlobal - ); - - // Now the prompt should have shown. - ok( - promptFired, - `Expect a prompt when turning permanent private browsing ${ - prefVal ? "on" : "off" - }!` - ); - BrowserTestUtils.removeTab(gBrowser.selectedTab); - await SpecialPowers.popPrefEnv(); - }; -} - -/** - * Check we show the prompt if the permanent private browsing pref is false - * and we flip the checkbox to true. - */ -add_task(checkForPrompt(true)); - -/** - * Check it works in the other direction: - */ -add_task(checkForPrompt(false)); diff --git a/browser/components/preferences/tests/head.js b/browser/components/preferences/tests/head.js @@ -690,54 +690,6 @@ async function selectHistoryMode(win, value) { await popupHiddenPromise; } -/** - * Select the given history mode in the redesigned privacy pane. - * - * @param {Window} win - The preferences window which contains the - * dropdown. - * @param {string} value - The history mode to select. - */ -async function selectRedesignedHistoryMode(win, value) { - let historyMode = win.document.querySelector( - "setting-group[groupid='history2'] #historyMode" - ); - let updated = waitForSettingControlChange(historyMode); - - let optionItems = Array.from(historyMode.children); - let targetItem = optionItems.find(option => option.value == value); - if (!targetItem) { - throw new Error( - "Could not find history mode popup item for value: " + value - ); - } - - if (historyMode.value == value) { - return; - } - - targetItem.click(); - await updated; -} - -async function updateCheckBoxElement(checkbox, value) { - ok(checkbox, "the " + checkbox.id + " checkbox should exist"); - is_element_visible( - checkbox, - "the " + checkbox.id + " checkbox should be visible" - ); - - // No need to click if we're already in the desired state. - if (checkbox.checked === value) { - return; - } - - // Scroll into view for click to succeed. - checkbox.scrollIntoView(); - - // Toggle the state. - await EventUtils.synthesizeMouseAtCenter(checkbox, {}, checkbox.ownerGlobal); -} - async function updateCheckBox(win, id, value) { let checkbox = win.document.getElementById(id); ok(checkbox, "the " + id + " checkbox should exist"); diff --git a/browser/components/preferences/tests/privacypane_tests_perwindow.js b/browser/components/preferences/tests/privacypane_tests_perwindow.js @@ -38,9 +38,7 @@ async function test_pane_visibility(win) { await selectHistoryMode(win, "custom"); for (let id of customElementIds) { - let element = win.document.querySelector( - `setting-group[groupid='history'] #${id}` - ); + let element = win.document.getElementById(id); ok(element, `the ${id} element should exist`); is_element_visible( element, @@ -51,9 +49,7 @@ async function test_pane_visibility(win) { await selectHistoryMode(win, "remember"); for (let id of customElementIds) { - let element = win.document.querySelector( - `setting-group[groupid='history'] #${id}` - ); + let element = win.document.getElementById(id); ok(element, `the ${id} element should exist`); is_element_hidden( element, @@ -156,24 +152,6 @@ async function test_dependent_elements(win) { await selectHistoryMode(win, "remember"); } -async function test_dependent_elements_redesigned(win) { - let historymode = win.document.getElementById("historyMode"); - ok(historymode, "history mode options should exist"); - - let customButton = win.document.getElementById("customHistoryButton"); - ok(customButton, "advanced settings button should exist"); - - // button should only change in custom mode - ok(customButton.parentDisabled, "button is disabled in remember mode"); - - // setting the mode to custom shouldn't change anything - await selectRedesignedHistoryMode(win, "custom"); - ok(!customButton.parentDisabled, "button is enabled in custom mode"); - - await selectRedesignedHistoryMode(win, "remember"); - ok(customButton.parentDisabled, "button is disabled in remember mode"); -} - async function test_dependent_cookie_elements(win) { let deleteOnCloseCheckbox = win.document.getElementById("deleteOnClose"); let deleteOnCloseNote = win.document.getElementById("deleteOnCloseInfo"); @@ -358,31 +336,6 @@ function test_historymode_retention(mode, expect) { }; } -function test_historymode_retention_redesign(mode, expect) { - return async function test_historymode_retention_fn(win) { - let historymode = win.document.getElementById("historyMode"); - ok(historymode, "history mode menulist should exist"); - - if ( - (historymode.value == "remember" && mode == "dontremember") || - (historymode.value == "dontremember" && mode == "remember") || - (historymode.value == "custom" && mode == "dontremember") - ) { - return; - } - - if (expect !== undefined) { - is( - historymode.value, - expect, - "history mode is expected to remain " + expect - ); - } - - await selectRedesignedHistoryMode(win, mode); - }; -} - function test_custom_retention(controlToChange, expect, valueIncrement) { return async function test_custom_retention_fn(win) { let historymode = win.document.getElementById("historyMode"); @@ -411,46 +364,6 @@ function test_custom_retention(controlToChange, expect, valueIncrement) { }; } -function test_custom_retention_redesign( - controlToChange, - expect, - valueIncrement -) { - return async function test_custom_retention_fn(win) { - let historymode = win.document.getElementById("historyMode"); - ok(historymode, "history mode options should exist"); - - if (expect !== undefined) { - is( - historymode.value, - expect, - "history mode is expected to remain " + expect - ); - } - - await selectRedesignedHistoryMode(win, "custom"); - - // Navigate to the custom subpane - let paneChange = waitForPaneChange("history"); - let customButton = win.document.getElementById("customHistoryButton"); - customButton.click(); - await paneChange; - - controlToChange = win.document.querySelector( - `setting-group[groupid='historyAdvanced'] #${controlToChange}` - ); - ok(controlToChange, "the control to change should exist"); - switch (controlToChange.localName) { - case "moz-checkbox": - await updateCheckBoxElement(controlToChange, !controlToChange.checked); - break; - case "menulist": - await selectRedesignedHistoryMode(win, valueIncrement); - break; - } - }; -} - const gPrefCache = new Map(); function cache_preferences(win) { diff --git a/browser/components/preferences/tests/siteData/browser.toml b/browser/components/preferences/tests/siteData/browser.toml @@ -25,8 +25,3 @@ skip-if = [ skip-if = [ "tsan", # Bug 1683730 ] - -["browser_siteData_srd.js"] -prefs = [ - "browser.settings-redesign.cookiesAndSiteData2.enabled=true" -] diff --git a/browser/components/preferences/tests/siteData/browser_siteData_srd.js b/browser/components/preferences/tests/siteData/browser_siteData_srd.js @@ -1,90 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ - -"use strict"; - -// When the settings redesign is complete, we should remove -// this and replace test_ui_loading_state in -// ./browser_siteData.js with this version. - -add_task(async function test_ui_loading_state() { - let updatedPromise = promiseSiteDataManagerSitesUpdated(); - await openPreferencesViaOpenPreferencesAPI("privacy", { leaveOpen: true }); - await updatedPromise; - let cacheSize = await SiteDataManager.getCacheSize(); - - let doc = gBrowser.selectedBrowser.contentDocument; - let clearBtn = doc.getElementById("clearSiteDataButton"); - let settingsButton = doc.getElementById("siteDataSettings"); - let totalSiteDataSizeLabel = doc.getElementById("siteDataSize"); - is( - clearBtn.disabled, - false, - "Should enable clear button after sites updated" - ); - is( - settingsButton.disabled, - false, - "Should enable settings button after sites updated" - ); - await SiteDataManager.getTotalUsage().then(usage => { - let [value, unit] = DownloadUtils.convertByteUnits(usage + cacheSize); - Assert.deepEqual( - doc.l10n.getAttributes(totalSiteDataSizeLabel), - { - id: "sitedata-total-size3", - args: { value, unit }, - }, - "Should show the right total site data size" - ); - }); - - Services.obs.notifyObservers(null, "sitedatamanager:updating-sites"); - // Wait a tick for the UI to update. - await new Promise(resolve => requestAnimationFrame(resolve)); - - is( - clearBtn.disabled, - true, - "Should disable clear button while updating sites" - ); - is( - settingsButton.disabled, - true, - "Should disable settings button while updating sites" - ); - Assert.equal( - doc.l10n.getAttributes(totalSiteDataSizeLabel).id, - "sitedata-total-size-calculating2", - "Should show the loading message while updating" - ); - - Services.obs.notifyObservers(null, "sitedatamanager:sites-updated"); - // Wait a tick for the UI to update. - await new Promise(resolve => setTimeout(resolve, 0)); - - is( - clearBtn.disabled, - false, - "Should enable clear button after sites updated" - ); - is( - settingsButton.disabled, - false, - "Should enable settings button after sites updated" - ); - cacheSize = await SiteDataManager.getCacheSize(); - await SiteDataManager.getTotalUsage().then(usage => { - let [value, unit] = DownloadUtils.convertByteUnits(usage + cacheSize); - Assert.deepEqual( - doc.l10n.getAttributes(totalSiteDataSizeLabel), - { - id: "sitedata-total-size3", - args: { value, unit }, - }, - "Should show the right total site data size" - ); - }); - - BrowserTestUtils.removeTab(gBrowser.selectedTab); -}); diff --git a/browser/components/preferences/widgets/setting-group/setting-group.mjs b/browser/components/preferences/widgets/setting-group/setting-group.mjs @@ -29,7 +29,6 @@ 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,48 +309,3 @@ 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 - -## Site Data - -sitedata-heading = - .label = Browsing data - .description = Manage your cookies, history, cache, website data, and more. - -sitedata-settings3 = - .label = Clear data for specific sites - .accesskey = s - -sitedata-cookies-exceptions3 = - .label = Manage exceptions - .accesskey = x - .description = Choose how specific sites handle cookies and site data. - -## History - -history-header2 = - .heading = History - -history-section-header = - .label = History - .description = Choose what you want { -brand-short-name } to remember when you close the browser. - -history-custom-section-header = - .label = Advanced settings - .description = Customize what you want { -brand-short-name } to remember when you close the browser. - -history-custom-button = - .label = Choose what you want { -brand-short-name } to remember 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,10 +17,7 @@ registerCleanupFunction(() => { add_setup(async () => { await SpecialPowers.pushPrefEnv({ - set: [ - ["signon.firefoxRelay.showToAllBrowsers", true], - ["browser.settings-redesign.nonTechnicalPrivacy2.enabled", true], - ], + set: [["signon.firefoxRelay.showToAllBrowsers", true]], }); }); @@ -344,7 +341,7 @@ add_task( }, async _browser => { const relayIntegrationCheckbox = content.document.querySelector( - "moz-checkbox#relayIntegration" + "checkbox#relayIntegration" ); relayIntegrationCheckbox.click(); }