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

Unified Diff: lib/stats.js

Issue 29532767: Issue 5593 - Use messaging in popup for prefs, whitelisting, and stats (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Revert one more instance of ext.pages.open Created Sept. 27, 2017, 9:40 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 | « lib/filterComposer.js ('k') | lib/whitelisting.js » ('j') | stats.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)));
« no previous file with comments | « lib/filterComposer.js ('k') | lib/whitelisting.js » ('j') | stats.js » ('J')

Powered by Google App Engine
This is Rietveld