Bug 1496375 - Update the blocker category states when the content blocking pref value changes r=johannh
authorEhsan Akhgari <ehsan@mozilla.com>
Thu, 11 Oct 2018 09:51:55 +0000
changeset 499149 0abcb61b9fc1d858ee127f49ddc2becaf98bf3c4
parent 499148 9d43c4ab83a569e16d0139e8fc12ec244005a376
child 499150 90fd055a420277d91231bb79508e8bd69b3b86f8
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjohannh
bugs1496375
milestone64.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 1496375 - Update the blocker category states when the content blocking pref value changes r=johannh Differential Revision: https://phabricator.services.mozilla.com/D8245
browser/base/content/browser-contentblocking.js
--- a/browser/base/content/browser-contentblocking.js
+++ b/browser/base/content/browser-contentblocking.js
@@ -340,16 +340,21 @@ var ContentBlocking = {
     this.content.toggleAttribute("enabled", this.enabled);
 
     if (this.contentBlockingUIEnabled) {
       this.appMenuButton.setAttribute("tooltiptext", this.enabled ?
         this.strings.disableTooltip : this.strings.enableTooltip);
       this.appMenuButton.setAttribute("enabled", this.enabled);
       this.appMenuButton.setAttribute("aria-pressed", this.enabled);
     }
+
+    // The enabled state of blockers may also change since it depends on this.enabled.
+    for (let blocker of this.blockers) {
+      blocker.categoryItem.classList.toggle("blocked", this.enabled && blocker.enabled);
+    }
   },
 
   updateUIEnabled() {
     this.content.toggleAttribute("contentBlockingUI", this.contentBlockingUIEnabled);
 
     if (this.contentBlockingUIEnabled) {
       this.appMenuLabel.setAttribute("label", this.strings.appMenuTitle);
       this.appMenuLabel.setAttribute("tooltiptext", this.strings.appMenuTooltip);