Commit fbf2f2bf authored by henry's avatar henry Committed by Pier Angelo Vendrame
Browse files

BB 44711: Hide unwanted setting controls in Base Browser.

parent 4178da7c
Loading
Loading
Loading
Loading
+19 −2
Original line number Diff line number Diff line
@@ -246,6 +246,7 @@ const CONFIG_PANES = Object.freeze({
    visible: () => srdSectionPrefs.all,
  },
  ai: {
    skip: true, // Skip AI pane. tor-browser#44709.
    l10nId: "preferences-ai-controls-header2",
    iconSrc: "chrome://global/skin/icons/highlights.svg",
    groupIds: ["aiControlsDescription", "aiFeatures", "aiStatesDescription"],
@@ -280,6 +281,7 @@ const CONFIG_PANES = Object.freeze({
    replaces: "privacy",
  },
  etp: {
    skip: true, // Skip enhanced tracking protection. tor-browser#33848.
    parent: "privacy",
    l10nId: "preferences-etp-header",
    groupIds: ["etpBanner", "etpAdvanced"],
@@ -328,6 +330,7 @@ const CONFIG_PANES = Object.freeze({
    visible: () => srdSectionEnabled("languages"),
  },
  manageAddresses: {
    skip: true,
    parent: "passwordsAutofill",
    l10nId: "autofill-addresses-manage-addresses-title",
    groupIds: ["manageAddresses"],
@@ -343,6 +346,7 @@ const CONFIG_PANES = Object.freeze({
    supportPage: "smart-window-memories",
  },
  managePayments: {
    skip: true,
    parent: "passwordsAutofill",
    l10nId: "autofill-payment-methods-manage-payments-title",
    groupIds: ["managePayments"],
@@ -443,6 +447,7 @@ const CONFIG_PANES = Object.freeze({
    visible: () => srdSectionEnabled("tabsBrowsing"),
  },
  translations: {
    skip: true, // Skip translations. tor-browser#44710.
    parent: srdSectionEnabled("languages") ? "languages" : "general",
    l10nId: "settings-translations-subpage-header",
    groupIds: [
@@ -542,10 +547,22 @@ function init_all() {
  }
  register_module("paneSearchResults", gSearchResultsPane);
  for (let [id, config] of Object.entries(CONFIG_PANES)) {
    if (!redesignEnabled && config.replaces) {
    // Skip over configs we do not want, including all its children.
    // See tor-browser#44711.
    let skip = false;
    let parentConfig = config;
    while (parentConfig) {
      skip = parentConfig.skip;
      if (skip) {
        break;
      }
      parentConfig = parentConfig.parent
        ? CONFIG_PANES[parentConfig.parent]
        : undefined;
    }
    if ((!redesignEnabled && config.replaces) || skip) {
      continue;
    }

    SettingPaneManager.registerPane(id, config);
  }

+6 −1
Original line number Diff line number Diff line
@@ -189,7 +189,11 @@
        iconsrc="chrome://browser/skin/translations.svg"
        data-l10n-id="pane-languages-title2">
      </html:moz-page-nav-button>
      <!-- We skip registering the "ai" pane (aiFeatures.mjs), which means
         - this item is non-functional and unmanaged. We have to
         - manually hide it instead. See tor-browser#44709. -->
      <html:moz-page-nav-button id="category-ai-features"
        hidden="true"
        view="paneAi"
        iconsrc="chrome://global/skin/icons/highlights.svg"
        data-l10n-id="pane-ai-controls-title2">
@@ -222,7 +226,8 @@
           navigated to from within other panes. -->
      <html:moz-page-nav-button class="hidden-category" view="paneContainers"/>
      <html:moz-page-nav-button class="hidden-category" view="paneProfiles"/>
      <html:moz-page-nav-button class="hidden-category" view="paneTranslations"/>
      <!-- Hide the translations sub-pane. tor-browser#44710. -->
      <html:moz-page-nav-button hidden="true" class="hidden-category" view="paneTranslations"/>

      <!-- Footer links -->
      <html:moz-page-nav-button id="addonsButton"
+7 −2
Original line number Diff line number Diff line
@@ -535,8 +535,13 @@

<html:setting-group groupid="passwords" hidden="true" data-category="panePrivacy"  data-srd-migrated=""/>

<html:setting-group data-category="panePrivacy" data-subcategory="payment-methods-autofill credit-card-autofill" groupid="payments" data-group="formAutofill" hidden="true"  data-srd-migrated="" />
<html:setting-group data-category="panePrivacy" data-subcategory="addresses-autofill address-autofill" groupid="addresses" data-group="formAutofill" hidden="true"  data-srd-migrated="" />
<!-- groupid="payments" and groupid="addresses" are configured by
   - FormAutofillPreferences.sys.mjs via FormAutofillStatus. But since the
   - "autofill" extension is excluded from the build, FormAutofillStatus is
   - never initialised. So we add the would-be data-hidden-* attributes
   - explicitly here instead. See tor-browser#44460. -->
<html:setting-group data-category="panePrivacy" data-subcategory="payment-methods-autofill credit-card-autofill" groupid="payments" data-group="formAutofill" hidden="true" data-hidden-from-search="true" data-hidden-by-setting-group=""  data-srd-migrated="" />
<html:setting-group data-category="panePrivacy" data-subcategory="addresses-autofill address-autofill" groupid="addresses" data-group="formAutofill" hidden="true" data-hidden-from-search="true" data-hidden-by-setting-group=""  data-srd-migrated="" />

<!-- History -->
<html:setting-group groupid="history" data-category="panePrivacy" hidden="true" data-srd-groupid="history2"/>