Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: popup.js

Issue 29340571: Issue 3687 - Add experimental support for Safari content blockers (Closed)
Patch Set: Don't avoid type conversion Created May 18, 2016, 9:24 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « options.js ('k') | safari/contentBlocking.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: popup.js
diff --git a/popup.js b/popup.js
index d611a7b44aa3bfd718e15635d0ec99297413008e..3b5a20a9758a09db95735d0c1bd0b273e55d644e 100644
--- a/popup.js
+++ b/popup.js
@@ -63,6 +63,17 @@ function onLoad()
document.body.classList.add("clickhide-active");
});
}
+
+ // For Safari, if the content blocking API is active we need to hide the
+ // stats section. (The content blocking API doesn't provide a way for us to
+ // offer those blocking statistics.)
+ ext.backgroundPage.sendMessage({type: "safari.contentBlockingActive"},
+ function (contentBlockingActive)
+ {
+ if (contentBlockingActive)
+ document.body.classList.add("contentblocking-active");
+ }
+ );
});
document.getElementById("enabled").addEventListener("click", toggleEnabled, false);
« no previous file with comments | « options.js ('k') | safari/contentBlocking.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld