Bug 1510734 - Content Blocking strict setting now uses network.cookie.cookieBehavior=4. r=johannh,flod
authorErica Wright <ewright@mozilla.com>
Thu, 06 Dec 2018 18:03:44 +0000
changeset 508774 1de7634102699e83608af8b16f758df090b23426
parent 508773 537b39da583098454476d886dcf8edd9c203c719
child 508775 c65b841c580211588d5201699993efd2ebc471d0
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjohannh, flod
bugs1510734
milestone65.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 1510734 - Content Blocking strict setting now uses network.cookie.cookieBehavior=4. r=johannh,flod The strict category should block third-party tracking cookies instead of all third-party cookies. This changes the requirements to match that category, so existing strict users will be moved to custom. Differential Revision: https://phabricator.services.mozilla.com/D13325
browser/components/nsBrowserGlue.js
browser/components/preferences/in-content/privacy.xul
browser/components/preferences/in-content/tests/browser_contentblocking.js
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -3036,17 +3036,17 @@ BrowserGlue.prototype = {
 
 var ContentBlockingCategoriesPrefs = {
   PREF_CB_CATEGORY: "browser.contentblocking.category",
   // The prefs inside CATEGORY_PREFS set expected value for each CB category.
   // A null value means that pref is default.
   CATEGORY_PREFS: {
     strict: [
       ["urlclassifier.trackingTable", null],
-      ["network.cookie.cookieBehavior", Ci.nsICookieService.BEHAVIOR_REJECT_FOREIGN],
+      ["network.cookie.cookieBehavior", Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER],
       ["privacy.trackingprotection.pbmode.enabled", true],
       ["privacy.trackingprotection.enabled", true],
     ],
     standard: [
       ["urlclassifier.trackingTable", null],
       ["network.cookie.cookieBehavior", null],
       ["privacy.trackingprotection.pbmode.enabled", null],
       ["privacy.trackingprotection.enabled", null],
--- a/browser/components/preferences/in-content/privacy.xul
+++ b/browser/components/preferences/in-content/privacy.xul
@@ -91,17 +91,17 @@
               <vbox class="content-blocking-extra-information">
                 <vbox class="indent">
                   <hbox class="extra-information-label">
                     <image class="content-blocking-trackers-image"/>
                     <label data-l10n-id="content-blocking-all-windows-trackers"/>
                   </hbox>
                   <hbox class="extra-information-label">
                     <image class="content-blocking-cookies-image"/>
-                    <label data-l10n-id="content-blocking-all-third-party-cookies"/>
+                    <label data-l10n-id="content-blocking-third-party-cookies"/>
                   </hbox>
                 </vbox>
                 <vbox class="content-blocking-warning">
                   <vbox class="indent">
                     <hbox>
                       <image class="content-blocking-warning-image"/>
                       <label class="content-blocking-warning-title" data-l10n-id="content-blocking-warning-title"/>
                     </hbox>
--- a/browser/components/preferences/in-content/tests/browser_contentblocking.js
+++ b/browser/components/preferences/in-content/tests/browser_contentblocking.js
@@ -187,17 +187,17 @@ add_task(async function testContentBlock
   strictRadioOption.click();
 
   // TP prefs are reset async to check for extensions controlling them.
   await TestUtils.waitForCondition(() => Services.prefs.prefHasUserValue(TP_PREF));
 
   is(Services.prefs.getStringPref(CAT_PREF), "strict", `${CAT_PREF} has been set to strict`);
   is(Services.prefs.getBoolPref(TP_PREF), true, `${TP_PREF} has been set to true`);
   is(Services.prefs.getBoolPref(TP_PBM_PREF), true, `${TP_PBM_PREF} has been set to true`);
-  is(Services.prefs.getIntPref(NCB_PREF), Ci.nsICookieService.BEHAVIOR_REJECT_FOREIGN, `${NCB_PREF} has been set to ${Ci.nsICookieService.BEHAVIOR_REJECT_FOREIGN}`);
+  is(Services.prefs.getIntPref(NCB_PREF), Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER, `${NCB_PREF} has been set to ${Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER}`);
   ok(!Services.prefs.prefHasUserValue(TP_LIST_PREF), `reset the pref ${TP_LIST_PREF}`);
 
   gBrowser.removeCurrentTab();
 });
 
 // Tests that the content blocking "Custom" category behaves as expected.
 add_task(async function testContentBlockingCustomCategory() {
   let prefs = [TP_LIST_PREF, TP_PREF, TP_PBM_PREF, NCB_PREF];
@@ -226,18 +226,18 @@ add_task(async function testContentBlock
   Services.prefs.setBoolPref(TP_PREF, false);
   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 NCB_PREF should necessarily set CAT_PREF to "custom"
-  Services.prefs.setIntPref(NCB_PREF, 4);
-  await TestUtils.waitForCondition(() => !Services.prefs.prefHasUserValue(NCB_PREF));
+  Services.prefs.setIntPref(NCB_PREF, Ci.nsICookieService.BEHAVIOR_ACCEPT);
+  await TestUtils.waitForCondition(() => Services.prefs.prefHasUserValue(NCB_PREF));
   is(Services.prefs.getStringPref(CAT_PREF), "custom", `${CAT_PREF} has been set to custom`);
 
   gBrowser.removeCurrentTab();
 });
 
 function checkControlState(doc, controls, enabled) {
   for (let selector of controls) {
     for (let control of doc.querySelectorAll(selector)) {