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

Unified Diff: webrequest.js

Issue 11627039: Added ad counting functionality (Closed)
Patch Set: Created Sept. 18, 2013, 10:07 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 | « stats.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrequest.js
===================================================================
--- a/webrequest.js
+++ b/webrequest.js
@@ -15,6 +15,8 @@
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
+var FilterNotifier = require("filterNotifier").FilterNotifier;
+
chrome.webRequest.onBeforeRequest.addListener(onBeforeRequest, {urls: ["http://*/*", "https://*/*"]}, ["blocking"]);
chrome.webRequest.onHeadersReceived.addListener(onHeadersReceived, {urls: ["http://*/*", "https://*/*"]}, ["responseHeaders"]);
chrome.tabs.onRemoved.addListener(forgetTab);
@@ -37,7 +39,7 @@
'load': true
};
-require("filterNotifier").FilterNotifier.addListener(function(action)
+FilterNotifier.addListener(function(action)
{
if (action in importantNotifications)
{
@@ -70,6 +72,7 @@
var frame = (type != "SUBDOCUMENT" ? details.frameId : details.parentFrameId);
var filter = checkRequest(type, details.tabId, details.url, frame);
+ FilterNotifier.triggerListeners("document.stats", filter, details.tabId);
if (filter instanceof BlockingFilter)
return {cancel: true};
else
« no previous file with comments | « stats.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld