Index: lib/icon.js |
=================================================================== |
--- a/lib/icon.js |
+++ b/lib/icon.js |
@@ -19,6 +19,8 @@ |
"use strict"; |
+let {FilterNotifier} = require("filterNotifier"); |
+ |
const frameOpacities = [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, |
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1, 0.0]; |
@@ -70,6 +72,16 @@ |
} |
} |
+FilterNotifier.addListener((action, page, filter) => |
+{ |
+ if (action == "page.WhitelistingStateRevalidate") |
+ { |
+ whitelistedState.set(page, !!filter); |
+ if (canUpdateIcon) |
+ setIcon(page); |
+ } |
+}); |
+ |
function renderFrames(notificationType) |
{ |
if (safariPlatform) |
@@ -155,20 +167,6 @@ |
}); |
} |
-/** |
- * Set the browser action icon for the given page, indicating whether |
- * adblocking is active there, and considering the icon animation. |
- * |
- * @param {Page} page The page to set the browser action icon for |
- * @param {Boolean} whitelisted Whether the page has been whitelisted |
- */ |
-exports.updateIcon = function(page, whitelisted) |
-{ |
- whitelistedState.set(page, whitelisted); |
- if (canUpdateIcon) |
- setIcon(page); |
-}; |
- |
let stopIconAnimation = |
/** |
* Stops to animate the browser action icon |