Bug 1502076 - Part 1: Remove the fastblock UI from Preferences r=flod,johannh
authorEhsan Akhgari <ehsan@mozilla.com>
Thu, 25 Oct 2018 21:24:58 +0000
changeset 443088 fc41d57ddd83ac90943b3b510ab71d03590af87b
parent 443087 aea0e7fadf7db4948b4bf8a818902ed79cbdab7d
child 443089 4579afb8b513704a4c668ebcf774dac31b25ab04
push id34937
push usernerli@mozilla.com
push dateFri, 26 Oct 2018 09:49:07 +0000
treeherdermozilla-central@2db84dbb7f99 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflod, johannh
bugs1502076
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 1502076 - Part 1: Remove the fastblock UI from Preferences r=flod,johannh Differential Revision: https://phabricator.services.mozilla.com/D9794
browser/app/profile/firefox.js
browser/components/preferences/in-content/privacy.js
browser/components/preferences/in-content/privacy.xul
browser/components/preferences/in-content/tests/browser_contentblocking.js
browser/components/preferences/in-content/tests/browser_spotlight.js
browser/locales/en-US/browser/preferences/preferences.ftl
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1522,17 +1522,16 @@ pref("browser.contentblocking.global-tog
 #endif
 
 #ifdef NIGHTLY_BUILD
 // Enable the Storage Access API in Nightly
 pref("dom.storage_access.enabled", true);
 #endif
 
 // Disable the UI for FastBlock in product.
-pref("browser.contentblocking.fastblock.ui.enabled", false);
 pref("browser.contentblocking.fastblock.control-center.ui.enabled", false);
 
 // Define a set of default features for the Content Blocking UI.
 pref("browser.contentblocking.trackingprotection.ui.enabled", true);
 pref("browser.contentblocking.trackingprotection.control-center.ui.enabled", true);
 pref("browser.contentblocking.rejecttrackers.ui.enabled", true);
 pref("browser.contentblocking.rejecttrackers.ui.recommended", true);
 pref("browser.contentblocking.rejecttrackers.control-center.ui.enabled", true);
--- a/browser/components/preferences/in-content/privacy.js
+++ b/browser/components/preferences/in-content/privacy.js
@@ -21,19 +21,16 @@ ChromeUtils.defineModuleGetter(this, "Si
 ChromeUtils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
 
 XPCOMUtils.defineLazyPreferenceGetter(this, "contentBlockingCookiesAndSiteDataRejectTrackersRecommended",
                                       "browser.contentblocking.cookies-site-data.ui.reject-trackers.recommended");
 
 XPCOMUtils.defineLazyPreferenceGetter(this, "contentBlockingCookiesAndSiteDataRejectTrackersEnabled",
                                       "browser.contentblocking.cookies-site-data.ui.reject-trackers.enabled");
 
-XPCOMUtils.defineLazyPreferenceGetter(this, "contentBlockingFastBlockUiEnabled",
-                                      "browser.contentblocking.fastblock.ui.enabled");
-
 XPCOMUtils.defineLazyPreferenceGetter(this, "contentBlockingTrackingProtectionUiEnabled",
                                       "browser.contentblocking.trackingprotection.ui.enabled");
 
 XPCOMUtils.defineLazyPreferenceGetter(this, "contentBlockingRejectTrackersUiEnabled",
                                       "browser.contentblocking.rejecttrackers.ui.enabled");
 
 XPCOMUtils.defineLazyPreferenceGetter(this, "contentBlockingRejectTrackersRecommended",
                                       "browser.contentblocking.rejecttrackers.ui.recommended");
@@ -62,19 +59,16 @@ XPCOMUtils.defineLazyGetter(this, "Alert
     return undefined;
   }
 });
 
 Preferences.addAll([
   // Content Blocking
   { id: "browser.contentblocking.enabled", type: "bool" },
 
-  // FastBlock
-  { id: "browser.fastblock.enabled", type: "bool" },
-
   // Tracking Protection
   { id: "privacy.trackingprotection.enabled", type: "bool" },
   { id: "privacy.trackingprotection.pbmode.enabled", type: "bool" },
   // This isn't a configuration pref, rather it's for saving the previous state
   // of the UI when we turn off the TP controls when the user checks off the
   // All Detected Trackers under Content Blocking.  This pref isn't listed in
   // all.js/firefox.js to make sure it doesn't appear in about:config by default.
   { id: "browser.privacy.trackingprotection.menu", type: "string" },
@@ -475,17 +469,16 @@ var gPrivacyPane = {
 
     let link = document.getElementById("contentBlockingLearnMore");
     let url = Services.urlFormatter.formatURLPref("app.support.baseURL") + "tracking-protection";
     link.setAttribute("href", url);
 
     // Honour our Content Blocking category UI prefs. If each pref is set to false,
     // Make all descendants of the corresponding selector hidden.
     let selectorPrefMap = {
-      ".fast-block-ui": contentBlockingFastBlockUiEnabled,
       ".tracking-protection-ui": contentBlockingTrackingProtectionUiEnabled,
       ".reject-trackers-ui": contentBlockingRejectTrackersUiEnabled,
     };
 
     for (let selector in selectorPrefMap) {
       let pref = selectorPrefMap[selector];
       if (!pref) {
         let elements = document.querySelectorAll(selector);
@@ -508,17 +501,16 @@ var gPrivacyPane = {
   async restoreContentBlockingPrefs() {
     function clearIfNotLocked(pref) {
       if (!Services.prefs.prefIsLocked(pref)) {
         Services.prefs.clearUserPref(pref);
       }
     }
 
     clearIfNotLocked("browser.contentblocking.enabled");
-    clearIfNotLocked("browser.fastblock.enabled");
     clearIfNotLocked("urlclassifier.trackingTable");
     clearIfNotLocked("network.cookie.cookieBehavior");
     clearIfNotLocked("network.cookie.lifetimePolicy");
 
     let controllingExtension = await getControllingExtension(
       PREF_SETTING_TYPE, TRACKING_PROTECTION_KEY);
     if (!controllingExtension) {
       for (let preference of TRACKING_PROTECTION_PREFS) {
--- a/browser/components/preferences/in-content/privacy.xul
+++ b/browser/components/preferences/in-content/privacy.xul
@@ -61,28 +61,16 @@
               data-l10n-attrs="tooltiptext"
               data-l10n-id="content-blocking-toggle-on"/>
       <label id="contentBlockingToggleLabel"
              data-l10n-id="content-blocking-toggle-label-on"
              control="contentBlockingToggle"/>
     </hbox>
     <vbox id="contentBlockingCategories">
       <label id="content-blocking-categories-label" data-l10n-id="content-blocking-category-label"/>
-      <hbox class="content-blocking-category fast-block-ui">
-        <vbox>
-          <checkbox id="contentBlockingFastBlockCheckbox"
-                    class="content-blocking-checkbox" flex="1"
-                    src="chrome://browser/skin/controlcenter/slowtrackers.svg"
-                    preference="browser.fastblock.enabled"
-                    data-l10n-id="content-blocking-fastblock-slow-loading-trackers-label"/>
-          <vbox class="content-blocking-category-labels" flex="1">
-            <description data-l10n-id="content-blocking-fastblock-new-description" class="content-blocking-category-description"/>
-          </vbox>
-        </vbox>
-      </hbox>
       <vbox>
         <hbox class="content-blocking-category tracking-protection-ui">
           <vbox>
             <checkbox id="contentBlockingTrackingProtectionCheckbox"
                       class="content-blocking-checkbox" flex="1"
                       src="chrome://browser/skin/controlcenter/trackers.svg"
                       data-l10n-id="content-blocking-tracking-protection-trackers-label"/>
             <vbox class="content-blocking-category-labels" flex="1">
--- a/browser/components/preferences/in-content/tests/browser_contentblocking.js
+++ b/browser/components/preferences/in-content/tests/browser_contentblocking.js
@@ -1,18 +1,16 @@
 /* eslint-env webextensions */
 
 const CB_PREF = "browser.contentblocking.enabled";
-const CB_FB_UI_PREF = "browser.contentblocking.fastblock.ui.enabled";
 const CB_TP_UI_PREF = "browser.contentblocking.trackingprotection.ui.enabled";
 const CB_RT_UI_PREF = "browser.contentblocking.rejecttrackers.ui.enabled";
 const TP_PREF = "privacy.trackingprotection.enabled";
 const TP_PBM_PREF = "privacy.trackingprotection.pbmode.enabled";
 const TP_LIST_PREF = "urlclassifier.trackingTable";
-const FB_PREF = "browser.fastblock.enabled";
 const NCB_PREF = "network.cookie.cookieBehavior";
 const TOGGLE_PREF = "browser.contentblocking.global-toggle.enabled";
 
 requestLongerTimeout(2);
 
 // Checks that the content blocking toggle follows and changes the CB pref.
 add_task(async function testContentBlockingToggle() {
   SpecialPowers.pushPrefEnv({set: [
@@ -55,17 +53,16 @@ add_task(async function testContentBlock
   Services.prefs.clearUserPref(CB_PREF);
   gBrowser.removeCurrentTab();
 });
 
 // Tests that the content blocking main category checkboxes have the correct default state.
 add_task(async function testContentBlockingMainCategory() {
   let prefs = [
     [CB_PREF, true],
-    [FB_PREF, true],
     [TP_PREF, false],
     [TP_PBM_PREF, true],
     [NCB_PREF, Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER],
   ];
 
   for (let pref of prefs) {
     switch (typeof pref[1]) {
       case "boolean":
@@ -73,33 +70,32 @@ add_task(async function testContentBlock
         break;
       case "number":
         SpecialPowers.setIntPref(pref[0], pref[1]);
         break;
     }
   }
 
   let checkboxes = [
-    "#contentBlockingFastBlockCheckbox",
     "#contentBlockingTrackingProtectionCheckbox",
     "#contentBlockingBlockCookiesCheckbox",
   ];
 
   await openPreferencesViaOpenPreferencesAPI("privacy", {leaveOpen: true});
   let doc = gBrowser.contentDocument;
 
   for (let selector of checkboxes) {
     let element = doc.querySelector(selector);
     ok(element, "checkbox " + selector + " exists");
     is(element.getAttribute("checked"), "true",
        "checkbox " + selector + " is checked");
   }
 
   // Ensure the dependent controls of the tracking protection subsection behave properly.
-  let tpCheckbox = doc.querySelector(checkboxes[1]);
+  let tpCheckbox = doc.querySelector(checkboxes[0]);
 
   let dependentControls = [
     "#trackingProtectionMenu",
   ];
   let alwaysEnabledControls = [
     "#trackingProtectionMenuDesc",
     ".content-blocking-category-name",
     "#changeBlockListLink",
@@ -152,17 +148,16 @@ add_task(async function testContentBlock
     SpecialPowers.clearUserPref(pref[0]);
   }
 });
 
 // Tests that the content blocking "Restore Defaults" button does what it's supposed to.
 add_task(async function testContentBlockingRestoreDefaults() {
   let prefs = {
     CB_PREF: null,
-    FB_PREF: null,
     TP_LIST_PREF: null,
     TP_PREF: null,
     TP_PBM_PREF: null,
     NCB_PREF: null,
   };
 
   for (let pref in prefs) {
     switch (Services.prefs.getPrefType(pref)) {
@@ -171,17 +166,16 @@ add_task(async function testContentBlock
       break;
     case Services.prefs.PREF_INT:
       prefs[pref] = Services.prefs.getIntPref(pref);
       break;
     }
   }
 
   Services.prefs.setBoolPref(CB_PREF, false);
-  Services.prefs.setBoolPref(FB_PREF, !Services.prefs.getBoolPref(FB_PREF));
   Services.prefs.setStringPref(TP_LIST_PREF, "test-track-simple,base-track-digest256,content-track-digest256");
   Services.prefs.setBoolPref(TP_PREF, true);
   Services.prefs.setBoolPref(TP_PBM_PREF, false);
   Services.prefs.setIntPref(NCB_PREF, Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER);
 
   for (let pref in prefs) {
     switch (Services.prefs.getPrefType(pref)) {
     case Services.prefs.PREF_BOOL:
@@ -229,34 +223,32 @@ add_task(async function testContentBlock
       applications: {gecko: {id: "@set_tp"}},
       permissions: ["privacy"],
     },
     background,
   });
 
   let resettable = {
     CB_PREF: null,
-    FB_PREF: null,
     TP_LIST_PREF: null,
     NCB_PREF: null,
   };
 
   for (let pref in resettable) {
     switch (Services.prefs.getPrefType(pref)) {
     case Services.prefs.PREF_BOOL:
       resettable[pref] = Services.prefs.getBoolPref(pref);
       break;
     case Services.prefs.PREF_INT:
       resettable[pref] = Services.prefs.getIntPref(pref);
       break;
     }
   }
 
   Services.prefs.setBoolPref(CB_PREF, false);
-  Services.prefs.setBoolPref(FB_PREF, !Services.prefs.getBoolPref(FB_PREF));
   Services.prefs.setStringPref(TP_LIST_PREF, "test-track-simple,base-track-digest256,content-track-digest256");
   Services.prefs.setIntPref(NCB_PREF, Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER);
 
   for (let pref in resettable) {
     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) != resettable[pref]) {
@@ -271,17 +263,16 @@ add_task(async function testContentBlock
     }
   }
 
   await extension.startup();
 
   await TestUtils.waitForCondition(() => Services.prefs.prefHasUserValue(TP_PREF));
 
   let dependentControls = [
-    ".fast-block-ui .content-blocking-checkbox",
     ".reject-trackers-ui .content-blocking-checkbox",
     "#content-blocking-categories-label",
     "#changeBlockListLink",
     "#contentBlockingChangeCookieSettings",
     "#blockCookiesCB, #blockCookiesCB > radio",
   ];
   let alwaysDisabledControls = [
     ".tracking-protection-ui .content-blocking-checkbox",
@@ -371,17 +362,16 @@ async function doDependentControlChecks(
   gBrowser.removeCurrentTab();
 }
 
 // Checks that the granular controls are disabled or enabled depending on the master pref for CB.
 add_task(async function testContentBlockingDependentControls() {
   // In Accept All Cookies mode, the radiogroup under Third-Party Cookies is always disabled
   // since the checkbox next to Third-Party Cookies would be unchecked.
   SpecialPowers.pushPrefEnv({set: [
-    [CB_FB_UI_PREF, true],
     [CB_TP_UI_PREF, true],
     [CB_RT_UI_PREF, true],
     [NCB_PREF, Ci.nsICookieService.BEHAVIOR_ACCEPT],
   ]});
 
   let dependentControls = [
     ".content-blocking-checkbox",
     "#content-blocking-categories-label",
@@ -397,17 +387,16 @@ add_task(async function testContentBlock
     "#blockCookiesMenu",
   ];
 
   await doDependentControlChecks(dependentControls, alwaysDisabledControls);
 
   // In Block Cookies from Trackers (or Block Cookies from All Third-Parties) mode, the
   // radiogroup's disabled status must obey the content blocking enabled state.
   SpecialPowers.pushPrefEnv({set: [
-    [CB_FB_UI_PREF, true],
     [CB_TP_UI_PREF, true],
     [CB_RT_UI_PREF, true],
     [NCB_PREF, Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER],
   ]});
 
   dependentControls = [
     ".content-blocking-checkbox",
     "#content-blocking-categories-label",
@@ -422,17 +411,16 @@ add_task(async function testContentBlock
   ];
 
   await doDependentControlChecks(dependentControls);
 });
 
 // Checks that the controls for tracking protection are disabled when all TP prefs are off.
 add_task(async function testContentBlockingDependentTPControls() {
   SpecialPowers.pushPrefEnv({set: [
-    [CB_FB_UI_PREF, true],
     [CB_TP_UI_PREF, true],
     [CB_RT_UI_PREF, true],
     [TP_PREF, false],
     [TP_PBM_PREF, false],
     [NCB_PREF, Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER],
   ]});
 
   let dependentControls = [
@@ -459,32 +447,29 @@ add_task(async function testContentBlock
 // when the Cookies and Site Data section is set to block either "All Cookies" or "Cookies from
 // unvisited websites".
 add_task(async function testContentBlockingDependentControlsOnSiteDataUI() {
   let prefValuesToTest = [
     Ci.nsICookieService.BEHAVIOR_REJECT,        // Block All Cookies
   ];
   for (let value of prefValuesToTest) {
     await SpecialPowers.pushPrefEnv({set: [
-      [CB_FB_UI_PREF, true],
       [CB_TP_UI_PREF, true],
       [CB_RT_UI_PREF, true],
       [TP_PREF, false],
       [TP_PBM_PREF, true],
       [NCB_PREF, value],
     ]});
 
     // When Block All Cookies is selected, the Third-Party Cookies section under Content Blocking
     // as well as the Keep Until controls under Cookies and Site Data should get disabled
     // unconditionally.
     let dependentControls = [
       "#content-blocking-categories-label",
-      "#contentBlockingFastBlockCheckbox",
       "#contentBlockingTrackingProtectionCheckbox",
-      ".fastblock-icon",
       ".tracking-protection-icon",
       "#trackingProtectionMenu",
       "[control=trackingProtectionMenu]",
       "#changeBlockListLink",
       "#contentBlockingChangeCookieSettings",
       "#blockCookies, #blockCookies > radio",
       "#blockCookiesLabel",
       "#blockCookiesMenu",
@@ -502,29 +487,26 @@ add_task(async function testContentBlock
 
   // When Block Cookies from unvisited websites is selected, the Third-Party Cookies section under
   // Content Blocking should get disabled unconditionally.
   prefValuesToTest = [
     Ci.nsICookieService.BEHAVIOR_LIMIT_FOREIGN, // Block Cookies from unvisited websites
   ];
   for (let value of prefValuesToTest) {
     await SpecialPowers.pushPrefEnv({set: [
-      [CB_FB_UI_PREF, true],
       [CB_TP_UI_PREF, true],
       [CB_RT_UI_PREF, true],
       [TP_PREF, false],
       [TP_PBM_PREF, true],
       [NCB_PREF, value],
     ]});
 
     let dependentControls = [
       "#content-blocking-categories-label",
-      "#contentBlockingFastBlockCheckbox",
       "#contentBlockingTrackingProtectionCheckbox",
-      ".fastblock-icon",
       ".tracking-protection-icon",
       "#trackingProtectionMenu",
       "[control=trackingProtectionMenu]",
       "#changeBlockListLink",
       "#contentBlockingChangeCookieSettings",
       "#blockCookies, #blockCookies > radio",
       "#blockCookiesLabel",
       "#blockCookiesMenu",
@@ -543,17 +525,16 @@ add_task(async function testContentBlock
   // When Accept All Cookies is selected, the radio buttons under Third-Party Cookies
   // in Content Blocking as well as the Type blocked controls in Cookies and Site Data
   // must remain disabled unconditionally.
   prefValuesToTest = [
     Ci.nsICookieService.BEHAVIOR_ACCEPT,         // Accept All Cookies
   ];
   for (let value of prefValuesToTest) {
     await SpecialPowers.pushPrefEnv({set: [
-      [CB_FB_UI_PREF, true],
       [CB_TP_UI_PREF, true],
       [CB_RT_UI_PREF, true],
       [TP_PREF, false],
       [TP_PBM_PREF, true],
       [NCB_PREF, value],
     ]});
 
     let dependentControls = [
@@ -579,17 +560,16 @@ add_task(async function testContentBlock
   // For other choices of cookie policies, no parts of the UI should get disabled
   // unconditionally.
   prefValuesToTest = [
     Ci.nsICookieService.BEHAVIOR_REJECT_FOREIGN, // Block All Third-Party Cookies
     Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER, // Block Cookies from third-party trackers
   ];
   for (let value of prefValuesToTest) {
     await SpecialPowers.pushPrefEnv({set: [
-      [CB_FB_UI_PREF, true],
       [CB_TP_UI_PREF, true],
       [CB_RT_UI_PREF, true],
       [TP_PREF, false],
       [TP_PBM_PREF, true],
       [NCB_PREF, value],
     ]});
 
     let dependentControls = [
@@ -612,17 +592,16 @@ add_task(async function testContentBlock
 });
 
 
 // Checks that the warnings in the Content Blocking Third-Party Cookies section correctly appear based on
 // the selections in the Cookies and Site Data section.
 add_task(async function testContentBlockingThirdPartyCookiesWarning() {
   await SpecialPowers.pushPrefEnv({set: [
     [CB_PREF, true],
-    [CB_FB_UI_PREF, true],
     [CB_TP_UI_PREF, true],
     [CB_RT_UI_PREF, true],
   ]});
 
   let expectedDeckIndex = new Map([
     [Ci.nsICookieService.BEHAVIOR_ACCEPT, 0],
     [Ci.nsICookieService.BEHAVIOR_REJECT_FOREIGN, 0],
     [Ci.nsICookieService.BEHAVIOR_REJECT, 1],
--- a/browser/components/preferences/in-content/tests/browser_spotlight.js
+++ b/browser/components/preferences/in-content/tests/browser_spotlight.js
@@ -48,17 +48,16 @@ add_task(async function test_form_autofi
   is(doc.querySelector(".spotlight").getAttribute("data-subcategory"), "form-autofill",
     "The form-autofill section is spotlighted.");
   BrowserTestUtils.removeTab(gBrowser.selectedTab);
 });
 
 add_task(async function test_change_cookie_settings() {
   await SpecialPowers.pushPrefEnv({set: [
     ["browser.contentblocking.enabled", true],
-    ["browser.contentblocking.fastblock.ui.enabled", true],
     ["browser.contentblocking.trackingprotection.ui.enabled", true],
     ["browser.contentblocking.rejecttrackers.ui.enabled", true],
   ]});
   let prefs = await openPreferencesViaOpenPreferencesAPI("privacy-trackingprotection", {leaveOpen: true});
   is(prefs.selectedPane, "panePrivacy", "Privacy pane is selected by default");
   let doc = gBrowser.contentDocument;
   is(doc.location.hash, "#privacy", "The subcategory should be removed from the URI");
   await TestUtils.waitForCondition(() => doc.querySelector(".spotlight"),
--- a/browser/locales/en-US/browser/preferences/preferences.ftl
+++ b/browser/locales/en-US/browser/preferences/preferences.ftl
@@ -832,23 +832,16 @@ content-blocking-toggle-off =
 
 content-blocking-toggle-label-on = ON
   .accesskey = O
 content-blocking-toggle-label-off = OFF
   .accesskey = O
 
 content-blocking-category-label = Choose what to block
 
-# "Slow" in this instance means "slow to load on the network".
-# FastBlock is a feature that blocks requests to tracking sites if they
-# have not finished loading after a certain threshold of seconds.
-content-blocking-fastblock-slow-loading-trackers-label =
-  .label = Slow-Loading Trackers
-  .accesskey = S
-content-blocking-fastblock-new-description = Block just the trackers that keep pages from loading quickly.
 content-blocking-tracking-protection-trackers-label =
   .label = Trackers
   .accesskey = T
 content-blocking-tracking-protection-all-detected-trackers-label =
   .label = All Detected Trackers
   .accesskey = T
 content-blocking-tracking-protection-new-description = Block all known trackers. (May prevent some pages from loading.)
 content-blocking-tracking-protection-option-always =