Bug 1543280 - Enable FP and CM in strict in all channel, enable FP and CM in standard for nightly and early beta. r=Ehsan
authorErica Wright <ewright@mozilla.com>
Tue, 16 Apr 2019 13:53:18 +0000
changeset 469668 00f2ad0a202a
parent 469667 04eccd9f23a1
child 469669 639d0d388b96
push id35879
push usernerli@mozilla.com
push dateTue, 16 Apr 2019 22:01:48 +0000
treeherdermozilla-central@12a60898fdc1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersEhsan
bugs1543280
milestone68.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 1543280 - Enable FP and CM in strict in all channel, enable FP and CM in standard for nightly and early beta. r=Ehsan Differential Revision: https://phabricator.services.mozilla.com/D27315
browser/app/profile/firefox.js
browser/components/preferences/in-content/tests/browser_contentblocking.js
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1537,20 +1537,24 @@ pref("toolkit.telemetry.ecosystemtelemet
 pref("browser.ping-centre.telemetry", true);
 pref("browser.ping-centre.log", false);
 pref("browser.ping-centre.staging.endpoint", "https://onyx_tiles.stage.mozaws.net/v3/links/ping-centre");
 pref("browser.ping-centre.production.endpoint", "https://tiles.services.mozilla.com/v3/links/ping-centre");
 
 // Enable GMP support in the addon manager.
 pref("media.gmp-provider.enabled", true);
 
+#ifdef EARLY_BETA_OR_EARLIER
 // Enable blocking access to storage from tracking resources only in nightly
 // and early beta. By default the value is 0: BEHAVIOR_ACCEPT
-#ifdef EARLY_BETA_OR_EARLIER
 pref("network.cookie.cookieBehavior", 4 /* BEHAVIOR_REJECT_TRACKER */);
+// Enable fingerprinting blocking by default only in nightly and early beta.
+pref("privacy.trackingprotection.fingerprinting.enabled", true);
+// Enable cryptomining blocking by default only in nightly and early beta.
+pref("privacy.trackingprotection.cryptomining.enabled", true);
 #endif
 
 pref("browser.contentblocking.allowlist.storage.enabled", true);
 
 pref("dom.storage_access.enabled", true);
 
 pref("dom.storage_access.auto_grants", true);
 pref("dom.storage_access.max_concurrent_auto_grants", 5);
@@ -1580,22 +1584,23 @@ pref("browser.contentblocking.fingerprin
 //     "-cm": cryptomining blocking disabled
 //   Cookie behavior:
 //     "cookieBehavior0": cookie behaviour BEHAVIOR_ACCEPT
 //     "cookieBehavior1": cookie behaviour BEHAVIOR_REJECT_FOREIGN
 //     "cookieBehavior2": cookie behaviour BEHAVIOR_REJECT
 //     "cookieBehavior3": cookie behaviour BEHAVIOR_LIMIT_FOREIGN
 //     "cookieBehavior4": cookie behaviour BEHAVIOR_REJECT_TRACKER
 // One value from each section must be included in each browser.contentblocking.features.* pref.
-pref("browser.contentblocking.features.strict", "tp,tpPrivate,cookieBehavior4,-cm,-fp");
-
+pref("browser.contentblocking.features.strict", "tp,tpPrivate,cookieBehavior4,cm,fp");
 // Enable blocking access to storage from tracking resources only in nightly
 // and early beta. By default the value is "cookieBehavior0": BEHAVIOR_ACCEPT
+// Enable cryptomining blocking in standard in nightly and early beta.
+// Enable fingerprinting blocking in standard in nightly and early beta.
 #ifdef EARLY_BETA_OR_EARLIER
-pref("browser.contentblocking.features.standard", "-tp,tpPrivate,cookieBehavior4,-cm,-fp");
+pref("browser.contentblocking.features.standard", "-tp,tpPrivate,cookieBehavior4,cm,fp");
 #else
 pref("browser.contentblocking.features.standard", "-tp,tpPrivate,cookieBehavior0,-cm,-fp");
 #endif
 
 // Enable the Report Breakage UI on Nightly and Beta but not on Release yet.
 #ifdef EARLY_BETA_OR_EARLIER
 pref("browser.contentblocking.reportBreakage.enabled", true);
 #else
--- a/browser/components/preferences/in-content/tests/browser_contentblocking.js
+++ b/browser/components/preferences/in-content/tests/browser_contentblocking.js
@@ -146,16 +146,17 @@ add_task(async function testContentBlock
     [TP_PREF]: null,
     [TP_PBM_PREF]: null,
     [NCB_PREF]: null,
     [FP_PREF]: null,
     [CM_PREF]: null,
   };
 
   for (let pref in prefs) {
+    Services.prefs.clearUserPref(pref);
     switch (Services.prefs.getPrefType(pref)) {
     case Services.prefs.PREF_BOOL:
       prefs[pref] = Services.prefs.getBoolPref(pref);
       break;
     case Services.prefs.PREF_INT:
       prefs[pref] = Services.prefs.getIntPref(pref);
       break;
     case Services.prefs.PREF_STRING:
@@ -164,18 +165,18 @@ add_task(async function testContentBlock
     default:
       ok(false, `Unknown pref type for ${pref}`);
     }
   }
 
   Services.prefs.setBoolPref(TP_PREF, true);
   Services.prefs.setBoolPref(TP_PBM_PREF, false);
   Services.prefs.setIntPref(NCB_PREF, Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER);
-  Services.prefs.setBoolPref(FP_PREF, true);
-  Services.prefs.setBoolPref(CM_PREF, true);
+  Services.prefs.setBoolPref(FP_PREF, !Services.prefs.getBoolPref(FP_PREF));
+  Services.prefs.setBoolPref(CM_PREF, !Services.prefs.getBoolPref(CM_PREF));
 
   for (let pref in prefs) {
     switch (Services.prefs.getPrefType(pref)) {
     case Services.prefs.PREF_BOOL:
       // Account for prefs that may have retained their default value
       if (Services.prefs.getBoolPref(pref) != prefs[pref]) {
         ok(Services.prefs.prefHasUserValue(pref), `modified the pref ${pref}`);
       }
@@ -267,17 +268,17 @@ add_task(async function testContentBlock
   await TestUtils.waitForCondition(() => !Services.prefs.prefHasUserValue(TP_PREF));
   is(Services.prefs.getStringPref(CAT_PREF), "custom", `${CAT_PREF} has been set to custom`);
 
   strictRadioOption.click();
   await TestUtils.waitForCondition(() => Services.prefs.getStringPref(CAT_PREF) == "strict");
 
   // Changing the FP_PREF and CM_PREF should necessarily set CAT_PREF to "custom"
   for (let pref of [FP_PREF, CM_PREF]) {
-    Services.prefs.setBoolPref(pref, true);
+    Services.prefs.setBoolPref(pref, !Services.prefs.getBoolPref(pref));
     await TestUtils.waitForCondition(() => Services.prefs.prefHasUserValue(pref));
     is(Services.prefs.getStringPref(CAT_PREF), "custom", `${CAT_PREF} has been set to custom`);
 
     strictRadioOption.click();
     await TestUtils.waitForCondition(() => Services.prefs.getStringPref(CAT_PREF) == "strict");
   }
 
   // Changing the NCB_PREF should necessarily set CAT_PREF to "custom"