Bug 1729045 - Part 1: Stop settings pref in the ETP custom mode. r=johannh
authorTim Huang <tihuang@mozilla.com>
Mon, 13 Sep 2021 11:29:18 +0000
changeset 591749 dc54f40f855054e7c9626806a3d783cf571e40b5
parent 591748 b1e9e503691d6f8da604a0e24d52f065d2041e29
child 591750 636378d072747f2b4a65ed7214d321cce30f603b
push id149606
push usertihuang@mozilla.com
push dateMon, 13 Sep 2021 11:31:47 +0000
treeherderautoland@636378d07274 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjohannh
bugs1729045
milestone94.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1729045 - Part 1: Stop settings pref in the ETP custom mode. r=johannh Differential Revision: https://phabricator.services.mozilla.com/D124652
browser/components/BrowserGlue.jsm
--- a/browser/components/BrowserGlue.jsm
+++ b/browser/components/BrowserGlue.jsm
@@ -4377,19 +4377,16 @@ var ContentBlockingCategoriesPrefs = {
         "privacy.trackingprotection.pbmode.enabled": null,
         "privacy.trackingprotection.enabled": null,
         "privacy.trackingprotection.socialtracking.enabled": null,
         "privacy.trackingprotection.fingerprinting.enabled": null,
         "privacy.trackingprotection.cryptomining.enabled": null,
         "privacy.annotate_channels.strict_list.enabled": null,
         "network.http.referer.disallowCrossSiteRelaxingDefault": null,
       },
-      custom: {
-        "network.http.referer.disallowCrossSiteRelaxingDefault": true,
-      },
     };
     let type = "strict";
     let rulesArray = Services.prefs
       .getStringPref(this.PREF_STRICT_DEF)
       .split(",");
     for (let item of rulesArray) {
       switch (item) {
         case "tp":
@@ -4588,16 +4585,21 @@ var ContentBlockingCategoriesPrefs = {
     this.setPrefsToCategory(value);
     this.switchingCategory = false;
   },
 
   /**
    * Sets all user-exposed content blocking preferences to values that match the selected category.
    */
   setPrefsToCategory(category) {
+    // Leave prefs as they were if we are switching to "custom" category.
+    if (category == "custom") {
+      return;
+    }
+
     for (let pref in this.CATEGORY_PREFS[category]) {
       let value = this.CATEGORY_PREFS[category][pref];
       if (!Services.prefs.prefIsLocked(pref)) {
         if (value == null) {
           Services.prefs.clearUserPref(pref);
         } else {
           switch (Services.prefs.getPrefType(pref)) {
             case Services.prefs.PREF_BOOL: