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

Unified Diff: lib/requestBlocker.js

Issue 29877564: Issue 6933 - Update adblockpluscore dependency to hg:dcda4859fcbd (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Rebase on next and update adblockplusui dependency Created Sept. 11, 2018, 1:40 p.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
« dependencies ('K') | « lib/indexedDBBackup.js ('k') | lib/stats.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/requestBlocker.js
===================================================================
--- a/lib/requestBlocker.js
+++ b/lib/requestBlocker.js
@@ -18,17 +18,17 @@
/** @module requestBlocker */
"use strict";
const {Filter, RegExpFilter, BlockingFilter} =
require("../adblockpluscore/lib/filterClasses");
const {Subscription} = require("../adblockpluscore/lib/subscriptionClasses");
const {defaultMatcher} = require("../adblockpluscore/lib/matcher");
-const {FilterNotifier} = require("../adblockpluscore/lib/filterNotifier");
+const {filterNotifier} = require("../adblockpluscore/lib/filterNotifier");
const {Prefs} = require("./prefs");
const {checkWhitelisted, getKey} = require("./whitelisting");
const {extractHostFromFrame, isThirdParty} = require("./url");
const {port} = require("./messaging");
const {logRequest: hitLoggerLogRequest} = require("./hitLogger");
const extensionProtocol = new URL(browser.extension.getURL("")).protocol;
@@ -118,17 +118,17 @@
return Promise.resolve([]);
return browser.tabs.query({url}).then(tabs => tabs.map(tab => tab.id));
}
function logRequest(tabIds, request, filter)
{
if (filter)
- FilterNotifier.emit("filter.hitCount", filter, 0, 0, tabIds);
+ filterNotifier.emit("filter.hitCount", filter, 0, 0, tabIds);
hitLoggerLogRequest(tabIds, request, filter);
}
browser.webRequest.onBeforeRequest.addListener(details =>
{
// Never block top-level documents.
if (details.type == "main_frame")
@@ -319,20 +319,20 @@
// but it's an expensive operation and that way we avoid to call
// it multiple times, if multiple filters are added/removed.
if (!browser.webNavigation.onBeforeNavigate
.hasListener(propagateHandlerBehaviorChange))
browser.webNavigation.onBeforeNavigate
.addListener(propagateHandlerBehaviorChange);
ignoreFilterNotifications = false;
- FilterNotifier.emit("filter.behaviorChanged");
+ filterNotifier.emit("filter.behaviorChanged");
});
}
-FilterNotifier.on("subscription.added", onFilterChange);
-FilterNotifier.on("subscription.removed", onFilterChange);
-FilterNotifier.on("subscription.updated", onFilterChange);
-FilterNotifier.on("subscription.disabled", arg => onFilterChange(arg, true));
-FilterNotifier.on("filter.added", onFilterChange);
-FilterNotifier.on("filter.removed", onFilterChange);
-FilterNotifier.on("filter.disabled", arg => onFilterChange(arg, true));
-FilterNotifier.on("load", onFilterChange);
+filterNotifier.on("subscription.added", onFilterChange);
+filterNotifier.on("subscription.removed", arg => onFilterChange(arg, false));
Manish Jethani 2018/09/11 13:43:37 Everything else is just simple renaming of things,
+filterNotifier.on("subscription.updated", onFilterChange);
+filterNotifier.on("subscription.disabled", arg => onFilterChange(arg, true));
+filterNotifier.on("filter.added", onFilterChange);
+filterNotifier.on("filter.removed", onFilterChange);
+filterNotifier.on("filter.disabled", arg => onFilterChange(arg, true));
+filterNotifier.on("load", onFilterChange);
« dependencies ('K') | « lib/indexedDBBackup.js ('k') | lib/stats.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld