Index: lib/stats.js |
=================================================================== |
--- a/lib/stats.js |
+++ b/lib/stats.js |
@@ -17,20 +17,22 @@ |
/** @module stats */ |
"use strict"; |
const {Prefs} = require("prefs"); |
const {BlockingFilter} = require("filterClasses"); |
const {FilterNotifier} = require("filterNotifier"); |
+const {port} = require("messaging"); |
const badgeColor = "#646464"; |
let blockedPerPage = new ext.PageMap(); |
+let getBlockedPerPage = |
/** |
* Gets the number of requests blocked on the given page. |
* |
* @param {Page} page |
* @return {Number} |
*/ |
exports.getBlockedPerPage = page => blockedPerPage.get(page) || 0; |
@@ -82,8 +84,11 @@ |
}; |
} |
} |
page.browserAction.setBadge(badge); |
} |
}); |
}); |
+ |
+port.on("stats.getBlockedPerPage", |
+ message => getBlockedPerPage(new ext.Page(message.tab))); |