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

Unified Diff: lib/antiadblockInit.js

Issue 29643698: Issue 6201 - Fix the "Hide targeted messages?" notification (Closed)
Patch Set: Addressed Wladimir's feedback Created Dec. 19, 2017, 12:25 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/antiadblockInit.js
diff --git a/lib/antiadblockInit.js b/lib/antiadblockInit.js
index 197d0fc3e8fe7c443ca28d779e6617b56bfdb60a..fa3d0de02d680333e9522f65c52d7d28ffc7eaee 100644
--- a/lib/antiadblockInit.js
+++ b/lib/antiadblockInit.js
@@ -46,13 +46,12 @@ exports.initAntiAdblockNotification = function initAntiAdblockNotification()
let urlFilters = [];
for (let filter of subscription.filters)
{
- if (filter instanceof ActiveFilter)
+ if (filter instanceof ActiveFilter && filter.domains)
{
- for (let domain in filter.domains)
+ for (let [domain, included] of filter.domains)
{
let urlFilter = "||" + domain + "^$document";
- if (domain && filter.domains[domain] &&
- urlFilters.indexOf(urlFilter) == -1)
+ if (domain && included && urlFilters.indexOf(urlFilter) == -1)
urlFilters.push(urlFilter);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld