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: Change whitelisting calls to use messaging Created Sept. 21, 2017, 7:54 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
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;
@@ -81,8 +83,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') | lib/whitelisting.js » ('J')

Powered by Google App Engine
This is Rietveld