Index: lib/stats.js |
=================================================================== |
--- a/lib/stats.js |
+++ b/lib/stats.js |
@@ -53,24 +53,28 @@ |
} |
}); |
-FilterNotifier.on("filter.hitCount", (filter, newValue, oldValue, page) => |
+FilterNotifier.on("filter.hitCount", (filter, newValue, oldValue, tabIds) => |
{ |
- if (!(filter instanceof BlockingFilter) || !page) |
+ if (!(filter instanceof BlockingFilter)) |
return; |
+ for (let tabId of tabIds) |
+ { |
+ let page = new ext.Page({id: tabId}); |
+ let blocked = blockedPerPage.get(page) || 0; |
+ blockedPerPage.set(page, ++blocked); |
+ |
+ // Update number in icon |
+ if (Prefs.show_statsinicon) |
+ { |
+ page.browserAction.setBadge({ |
+ color: badgeColor, |
+ number: blocked |
+ }); |
+ } |
+ } |
+ |
Prefs.blocked_total++; |
- |
- let blocked = blockedPerPage.get(page) || 0; |
- blockedPerPage.set(page, ++blocked); |
- |
- // Update number in icon |
- if (Prefs.show_statsinicon) |
- { |
- page.browserAction.setBadge({ |
- color: badgeColor, |
- number: blocked |
- }); |
- } |
}); |
Prefs.on("show_statsinicon", () => |