tor-browser

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

commit 72f50387afb69407f4c14f3e4053a61226ce1aa0
parent e2a4ccbdd91d64aba8576c87f795eeff5c2e92d5
Author: Narcis Beleuzu <nbeleuzu@mozilla.com>
Date:   Mon,  6 Oct 2025 23:31:31 +0300

Revert "Bug 1971433 - Convert Certificates section to config-based prefs - r=emz,fluent-reviewers,hjones,bolsson" for causing lint failure on main.js

This reverts commit 53350bc108bf9dcc69b2b57bd727455489046914.

This reverts commit 81522951ca3821988c3c443ac0dc62ae7a6dc7a5.

Diffstat:
Mbrowser/components/preferences/main.inc.xhtml | 46+++++++++++++++++++++++++++++++++++++---------
Mbrowser/components/preferences/main.js | 62+++++---------------------------------------------------------
Mbrowser/components/preferences/privacy.inc.xhtml | 61++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
Mbrowser/components/preferences/privacy.js | 76+++++++++++++++++++++++++++++-----------------------------------------------
Mbrowser/components/preferences/widgets/setting-group/setting-group.mjs | 2--
Mbrowser/locales/en-US/browser/preferences/preferences.ftl | 8+++-----
Dpython/l10n/fluent_migrations/bug_1971433_preferences.py | 39---------------------------------------
Msecurity/manager/locales/en-US/chrome/pippki/pippki.properties | 3+--
8 files changed, 135 insertions(+), 162 deletions(-)

diff --git a/browser/components/preferences/main.inc.xhtml b/browser/components/preferences/main.inc.xhtml @@ -654,14 +654,42 @@ <!-- Network Settings--> <groupbox id="connectionGroup" data-category="paneGeneral" hidden="true"> <label class="search-header" hidden="true"><html:h2 data-l10n-id="network-settings-title"/></label> - <description flex="1" control="connectionSettings" data-subcategory="netsettings" - class="section-description"> - <html:span id="connectionSettingsDescription"/> - <html:a is="moz-support-link" - data-l10n-id="network-proxy-connection-learn-more" - support-page="prefs-connection-settings" - /> - </description> - <html:setting-group groupid="networkProxy" /> + + <hbox align="center" + data-subcategory="netsettings"> + <description flex="1" control="connectionSettings"> + <html:span id="connectionSettingsDescription"/> + <html:a is="moz-support-link" + data-l10n-id="network-proxy-connection-learn-more" + support-page="prefs-connection-settings" + /> + </description> + <separator orient="vertical"/> + <button id="connectionSettings" + is="highlightable-button" + class="accessory-button" + data-l10n-id="network-proxy-connection-settings" + search-l10n-ids=" + connection-window2.title, + connection-proxy-option-no.label, + connection-proxy-option-auto.label, + connection-proxy-option-system.label, + connection-proxy-option-wpad.label, + connection-proxy-option-manual.label, + connection-proxy-http, + connection-proxy-https, + connection-proxy-http-port, + connection-proxy-socks, + connection-proxy-socks4, + connection-proxy-socks5, + connection-proxy-noproxy, + connection-proxy-noproxy-desc, + connection-proxy-https-sharing.label, + connection-proxy-autotype.label, + connection-proxy-reload.label, + connection-proxy-autologin-checkbox.label, + connection-proxy-socks-remote-dns.label, + " /> + </hbox> </groupbox> </html:template> diff --git a/browser/components/preferences/main.js b/browser/components/preferences/main.js @@ -569,11 +569,6 @@ Preferences.addSetting({ }); Preferences.addSetting({ id: "containersPlaceholder" }); -Preferences.addSetting({ - id: "connectionSettings", - onUserClick: () => gMainPane.showConnections(), -}); - // Downloads /* * Preferences: @@ -1366,43 +1361,6 @@ let SETTINGS_CONFIG = { }, ], }, - certificates: { - l10nId: "certs-description2", - supportPage: "secure-website-certificate", - headingLevel: 2, - items: [ - { - id: "certificateButtonGroup", - control: "moz-box-group", - items: [ - { - id: "viewCertificatesButton", - l10nId: "certs-view", - control: "moz-box-button", - controlAttrs: { - "search-l10n-ids": - "certmgr-tab-mine.label,certmgr-tab-people.label,certmgr-tab-servers.label,certmgr-tab-ca.label,certmgr-mine,certmgr-people,certmgr-server,certmgr-ca,certmgr-cert-name.label,certmgr-token-name.label,certmgr-view.label,certmgr-export.label,certmgr-delete.label", - }, - }, - { - id: "viewSecurityDevicesButton", - l10nId: "certs-devices", - control: "moz-box-button", - controlAttrs: { - "search-l10n-ids": - "devmgr-window.title,devmgr-devlist.label,devmgr-header-details.label,devmgr-header-value.label,devmgr-button-login.label,devmgr-button-logout.label,devmgr-button-changepw.label,devmgr-button-load.label,devmgr-button-unload.label,certs-devices-enable-fips", - }, - }, - ], - }, - - { - id: "certEnableThirdPartyToggle", - l10nId: "certs-thirdparty-toggle", - supportPage: "automatically-trust-third-party-certificates", - }, - ], - }, browsingProtection: { items: [ { @@ -1538,20 +1496,6 @@ let SETTINGS_CONFIG = { { id: "deleteOnClose", l10nId: "sitedata-delete-on-close", - networkProxy: { - items: [ - { - id: "connectionSettings", - l10nId: "network-proxy-connection-settings", - control: "moz-box-button", - controlAttrs: { - "search-l10n-ids": - "connection-window2.title,connection-proxy-option-no.label,connection-proxy-option-auto.label,connection-proxy-option-system.label,connection-proxy-option-wpad.label,connection-proxy-option-manual.label,connection-proxy-http,connection-proxy-https,connection-proxy-http-port,connection-proxy-socks,connection-proxy-socks4,connection-proxy-socks5,connection-proxy-noproxy,connection-proxy-noproxy-desc,connection-proxy-https-sharing.label,connection-proxy-autotype.label,connection-proxy-reload.label,connection-proxy-autologin-checkbox.label,connection-proxy-socks-remote-dns.label", - }, - // Bug 1990552: due to how this lays out in the legacy page, we do not include a - // controllingExtensionInfo attribute here. We will want one in the redesigned page, - // using storeId: "proxy.settings". - controllingExtensionInfo: undefined, }, ], }, @@ -1672,7 +1616,6 @@ var gMainPane = { initSettingGroup("zoom"); initSettingGroup("performance"); initSettingGroup("startup"); - initSettingGroup("networkProxy"); if (AppConstants.platform == "win") { // Functionality for "Show tabs in taskbar" on Windows 7 and up. @@ -1778,6 +1721,11 @@ var gMainPane = { ); gMainPane.updateColorsButton(); setEventListener( + "connectionSettings", + "command", + gMainPane.showConnections + ); + setEventListener( "browserContainersCheckbox", "command", gMainPane.checkBrowserContainers diff --git a/browser/components/preferences/privacy.inc.xhtml b/browser/components/preferences/privacy.inc.xhtml @@ -1050,7 +1050,66 @@ <!-- Certificates --> <groupbox id="certSelection" data-category="panePrivacy" hidden="true"> - <html:setting-group groupid="certificates"></html:setting-group> + <label><html:h2 data-l10n-id="certs-header"/></label> + <hbox align="start"> + <vbox data-subcategory="certs" flex="1"> + <description id="certsDescription" class="description-deemphasized" data-l10n-id="certs-description"/> + <html:a is="moz-support-link" + class="learnMore" + support-page="secure-website-certificate" + /> + </vbox> + <vbox align="end"> + <button id="viewCertificatesButton" + is="highlightable-button" + class="accessory-button" + data-l10n-id="certs-view" + preference="security.disable_button.openCertManager" + search-l10n-ids=" + certmgr-tab-mine.label, + certmgr-tab-people.label, + certmgr-tab-servers.label, + certmgr-tab-ca.label, + certmgr-mine, + certmgr-people, + certmgr-server, + certmgr-ca, + certmgr-cert-name.label, + certmgr-token-name.label, + certmgr-view.label, + certmgr-export.label, + certmgr-delete.label + "/> + <button id="viewSecurityDevicesButton" + is="highlightable-button" + class="accessory-button" + data-l10n-id="certs-devices" + preference="security.disable_button.openDeviceManager" + search-l10n-ids=" + devmgr-window.title, + devmgr-devlist.label, + devmgr-header-details.label, + devmgr-header-value.label, + devmgr-button-login.label, + devmgr-button-logout.label, + devmgr-button-changepw.label, + devmgr-button-load.label, + devmgr-button-unload.label + "/> + </vbox> + </hbox> + + <hbox id="certEnableThirdPartyToggleBox" align="center"> + <checkbox id="certEnableThirdPartyToggle" + data-l10n-id="certs-thirdparty-toggle" + preference="security.enterprise_roots.enabled" + class="tail-with-learn-more" + /> + <html:a is="moz-support-link" + class="learnMore" + support-page="automatically-trust-third-party-certificates" + /> + </hbox> </groupbox> <!-- HTTPS-ONLY Mode --> diff --git a/browser/components/preferences/privacy.js b/browser/components/preferences/privacy.js @@ -1765,52 +1765,6 @@ Preferences.addSetting({ }, }); -Preferences.addSetting({ - id: "certificateButtonGroup", -}); -Preferences.addSetting({ - id: "disableOpenCertManager", - pref: "security.disable_button.openCertManager", -}); -Preferences.addSetting({ - id: "disableOpenDeviceManager", - pref: "security.disable_button.openDeviceManager", -}); -Preferences.addSetting({ - id: "viewCertificatesButton", - deps: ["disableOpenCertManager"], - disabled: deps => { - return deps.disableOpenCertManager.value; - }, - onUserClick: () => { - gPrivacyPane.showCertificates(); - }, -}); -Preferences.addSetting({ - id: "viewSecurityDevicesButton", - deps: ["disableOpenDeviceManager"], - disabled: deps => { - return deps.disableOpenDeviceManager.value; - }, - onUserClick: () => { - gPrivacyPane.showSecurityDevices(); - }, -}); -Preferences.addSetting({ - id: "certEnableThirdPartyToggle", - pref: "security.enterprise_roots.enabled", - visible: () => { - // Third-party certificate import is only implemented for Windows and Mac, - // and we should not expose this as a user-configurable setting if there's - // an enterprise policy controlling it (either to enable _or_ disable it). - return ( - (AppConstants.platform == "win" || AppConstants.platform == "macosx") && - typeof Services.policies.getActivePolicies()?.Certificates - ?.ImportEnterpriseRoots == "undefined" - ); - }, -}); - function setEventListener(aId, aEventType, aCallback) { document .getElementById(aId) @@ -2004,6 +1958,19 @@ var gPrivacyPane = { exceptionListService.maybeMigrateCategoryPrefs(); }, + _initThirdPartyCertsToggle() { + // Third-party certificate import is only implemented for Windows and Mac, + // and we should not expose this as a user-configurable setting if there's + // an enterprise policy controlling it (either to enable _or_ disable it). + let canConfigureThirdPartyCerts = + (AppConstants.platform == "win" || AppConstants.platform == "macosx") && + typeof Services.policies.getActivePolicies()?.Certificates + ?.ImportEnterpriseRoots == "undefined"; + + document.getElementById("certEnableThirdPartyToggleBox").hidden = + !canConfigureThirdPartyCerts; + }, + get dnsOverHttpsResolvers() { let providers = DoHConfigController.currentConfig.providerList; // if there's no default, we'll hold its position with an empty string @@ -2401,7 +2368,6 @@ var gPrivacyPane = { initSettingGroup("httpsOnly"); initSettingGroup("browsingProtection"); initSettingGroup("cookiesAndSiteData"); - initSettingGroup("certificates"); this.initNonTechnicalPrivacySection(); @@ -2419,6 +2385,7 @@ var gPrivacyPane = { this.networkCookieBehaviorReadPrefs(); this._initTrackingProtectionExtensionControl(); this._ensureTrackingProtectionExceptionListMigration(); + this._initThirdPartyCertsToggle(); this._initProfilesInfo(); Preferences.get("privacy.trackingprotection.enabled").on( @@ -2515,6 +2482,16 @@ var gPrivacyPane = { "command", gPrivacyPane.showAddonExceptions ); + setEventListener( + "viewCertificatesButton", + "command", + gPrivacyPane.showCertificates + ); + setEventListener( + "viewSecurityDevicesButton", + "command", + gPrivacyPane.showSecurityDevices + ); this._pane = document.getElementById("panePrivacy"); @@ -2657,9 +2634,14 @@ var gPrivacyPane = { } let signonBundle = document.getElementById("signonBundle"); + let pkiBundle = document.getElementById("pkiBundle"); appendSearchKeywords("showPasswords", [ signonBundle.getString("loginsDescriptionAll2"), ]); + appendSearchKeywords("viewSecurityDevicesButton", [ + pkiBundle.getString("enable_fips"), + ]); + if (!PrivateBrowsingUtils.enabled) { document.getElementById("privateBrowsingAutoStart").hidden = true; document.querySelector("menuitem[value='dontremember']").hidden = true; diff --git a/browser/components/preferences/widgets/setting-group/setting-group.mjs b/browser/components/preferences/widgets/setting-group/setting-group.mjs @@ -14,7 +14,6 @@ const CLICK_HANDLERS = new Set([ "moz-box-item", "moz-box-link", "moz-button", - "moz-box-group", ]); export class SettingGroup extends MozLitElement { @@ -91,7 +90,6 @@ export class SettingGroup extends MozLitElement { return html`<moz-fieldset data-l10n-id=${ifDefined(this.config.l10nId)} .headingLevel=${this.config.headingLevel} - .supportPage=${ifDefined(this.config.supportPage)} @change=${this.onChange} @click=${this.onClick} >${this.config.items.map(item => this.itemTemplate(item))}</moz-fieldset diff --git a/browser/locales/en-US/browser/preferences/preferences.ftl b/browser/locales/en-US/browser/preferences/preferences.ftl @@ -1581,9 +1581,9 @@ security-block-uncommon-software = ## Privacy Section - Certificates -certs-description2 = - .label = Certificates - .description = Configure the certificates that { -brand-short-name } uses for authentication. +certs-header = Certificates + +certs-description = Configure the certificates that { -brand-short-name } uses for authentication. certs-view = .label = View Certificates… @@ -1597,8 +1597,6 @@ certs-thirdparty-toggle = .label = Allow { -brand-short-name } to automatically trust third-party root certificates you install .accesskey = t -certs-devices-enable-fips = Enable FIPS - space-alert-over-5gb-settings-button = .label = Open Settings .accesskey = O diff --git a/python/l10n/fluent_migrations/bug_1971433_preferences.py b/python/l10n/fluent_migrations/bug_1971433_preferences.py @@ -1,39 +0,0 @@ -# Any copyright is dedicated to the Public Domain. -# http://creativecommons.org/publicdomain/zero/1.0/ - -import fluent.syntax.ast as FTL -from fluent.migrate import COPY_PATTERN -from fluent.migrate.transforms import COPY -from fluent.migrate.helpers import transforms_from - - -def migrate(ctx): - """Bug 1971433 - Convert Certificates section to config-based prefs - part {index}""" - - # part 1, migrate a legacy string - source = "security/manager/chrome/pippki/pippki.properties" - target = "browser/browser/preferences/preferences.ftl" - ctx.add_transforms( - target, - target, - [ - FTL.Message( - id=FTL.Identifier("certs-devices-enable-fips"), - value=COPY(source, "enable_fips"), - ) - ], - ) - - # part 2, restructure existing strings - ctx.add_transforms( - target, - target, - transforms_from( - """ -certs-description2 = - .label = {COPY_PATTERN(from_path, "certs-header")} - .description = {COPY_PATTERN(from_path, "certs-description")} -""", - from_path=target, - ), - ) diff --git a/security/manager/locales/en-US/chrome/pippki/pippki.properties b/security/manager/locales/en-US/chrome/pippki/pippki.properties @@ -2,8 +2,6 @@ # 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/. -# FTL path: browser/locales/en-US/browser/preferences/preferences.ftl - # Download Cert dialog # LOCALIZATION NOTE(newCAMessage1): # %S is a string representative of the certificate being downloaded/imported. @@ -33,3 +31,4 @@ pageInfo_CertificateTransparency_Compliant=This website complies with the Certif # Token Manager password_not_set=(not set) +enable_fips=Enable FIPS