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++; |
kzar
2018/04/03 17:14:03
Seems like before we didn't increment this counter
Sebastian Noack
2018/04/04 01:50:33
Yes. To me it seems a mistake that we didn't befor
|
- |
- 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", () => |