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

Unified Diff: lib/whitelisting.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
« lib/requestBlocker.js ('K') | « lib/subscriptionInit.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/whitelisting.js
===================================================================
--- a/lib/whitelisting.js
+++ b/lib/whitelisting.js
@@ -16,17 +16,17 @@
*/
/** @module whitelisting */
"use strict";
const {defaultMatcher} = require("../adblockpluscore/lib/matcher");
const {Filter, RegExpFilter} = require("../adblockpluscore/lib/filterClasses");
-const {FilterNotifier} = require("../adblockpluscore/lib/filterNotifier");
+const {filterNotifier} = require("../adblockpluscore/lib/filterNotifier");
const {FilterStorage} = require("../adblockpluscore/lib/filterStorage");
const {extractHostFromFrame, isThirdParty} = require("./url");
const {port} = require("./messaging");
const {logWhitelistedDocument} = require("./hitLogger");
const {verifySignature} = require("../adblockpluscore/lib/rsa");
let sitekeys = new ext.PageMap();
@@ -88,17 +88,17 @@
return !!checkWhitelisted(new ext.Page(message.tab));
});
port.on("filters.whitelist", message =>
{
let page = new ext.Page(message.tab);
let host = page.url.hostname.replace(/^www\./, "");
let filter = Filter.fromText("@@||" + host + "^$document");
- if (filter.subscriptions.size && filter.disabled)
+ if (filter.subscriptionCount && filter.disabled)
{
filter.disabled = false;
}
else
{
filter.disabled = false;
FilterStorage.addFilter(filter);
}
@@ -107,31 +107,31 @@
port.on("filters.unwhitelist", message =>
{
let page = new ext.Page(message.tab);
// Remove any exception rules applying to this URL
let filter = checkWhitelisted(page);
while (filter)
{
FilterStorage.removeFilter(filter);
- if (filter.subscriptions.size)
+ if (filter.subscriptionCount)
filter.disabled = true;
filter = checkWhitelisted(page);
}
});
function revalidateWhitelistingState(page)
{
- FilterNotifier.emit(
+ filterNotifier.emit(
"page.WhitelistingStateRevalidate",
page, checkWhitelisted(page)
);
}
-FilterNotifier.on("filter.behaviorChanged", () =>
+filterNotifier.on("filter.behaviorChanged", () =>
{
browser.tabs.query({}, tabs =>
{
for (let tab of tabs)
revalidateWhitelistingState(new ext.Page(tab));
});
});
« lib/requestBlocker.js ('K') | « lib/subscriptionInit.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld