From 060f67d20fc1dfb58881ff45472f67e2542de305 Mon Sep 17 00:00:00 2001 From: Nihanth Subramanya Date: Thu, 8 Aug 2019 10:41:02 +0000 Subject: [PATCH] Bug 1555237 - Implement "No Trackers Detected" section. r=johannh Differential Revision: https://phabricator.services.mozilla.com/D41109 --HG-- extra : moz-landing-system : lando --- browser/base/content/browser-siteProtections.js | 12 ++++++++++++ .../controlcenter/content/protectionsPanel.inc.xul | 5 +++-- browser/themes/shared/controlcenter/panel.inc.css | 8 ++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/browser/base/content/browser-siteProtections.js b/browser/base/content/browser-siteProtections.js index 336c93e1c060..f7b8807eb3f8 100644 --- a/browser/base/content/browser-siteProtections.js +++ b/browser/base/content/browser-siteProtections.js @@ -1222,6 +1222,13 @@ var gProtectionsHandler = { return SocialTracking.sessionPageLoad; }, + get noTrackersDetectedDescription() { + delete this.noTrackersDetectedDescription; + return (this.noTrackersDetectedDescription = document.getElementById( + "protections-popup-no-trackers-found-description" + )); + }, + get blockingSectionDescription() { delete this.blockingSectionDescription; return (this.blockingSectionDescription = document.getElementById( @@ -1546,6 +1553,7 @@ var gProtectionsHandler = { let anyDetected = false; let anyBlocking = false; + this.noTrackersDetectedDescription.hidden = false; this.blockingSectionDescription.hidden = true; this.notBlockingSectionDescription.hidden = true; @@ -1568,6 +1576,10 @@ var gProtectionsHandler = { anyBlocking = anyBlocking || blocker.activated; } + if (anyDetected) { + this.noTrackersDetectedDescription.hidden = true; + } + // Check whether the user has added an exception for this site. let hasException = ContentBlockingAllowList.includes( gBrowser.selectedBrowser diff --git a/browser/components/controlcenter/content/protectionsPanel.inc.xul b/browser/components/controlcenter/content/protectionsPanel.inc.xul index 3e75c128d98a..422065672288 100644 --- a/browser/components/controlcenter/content/protectionsPanel.inc.xul +++ b/browser/components/controlcenter/content/protectionsPanel.inc.xul @@ -50,7 +50,8 @@ - + + &protections.noTrackersFound.description; &protections.notBlocking.why.etpOn.tooltip; &protections.notBlocking.why.etpOff.tooltip; @@ -104,7 +105,7 @@ - +