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

Unified Diff: lib/abp2blocklist.js

Issue 29457578: Issue 4327 - Do not apply $subdocument filters to top-level documents (Closed) Base URL: https://hg.adblockplus.org/abp2blocklist
Patch Set: Created June 6, 2017, 12:50 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 | test/abp2blocklist.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/abp2blocklist.js
===================================================================
--- a/lib/abp2blocklist.js
+++ b/lib/abp2blocklist.js
@@ -309,16 +309,23 @@
trigger["if-domain"].push("*" + name);
}
}
}
else if (excluded.length > 0)
{
trigger["unless-domain"] = excluded.map(name => "*" + name);
}
+ else if (filter instanceof filterClasses.BlockingFilter &&
+ filter.contentType & typeMap.SUBDOCUMENT)
+ {
+ trigger["unless-top-url"] = [trigger["url-filter"]];
+ if (trigger["url-filter-is-case-sensitive"])
+ trigger["top-url-filter-is-case-sensitive"] = true;
+ }
rules.push({trigger: trigger, action: {type: action}});
}
function hasNonASCI(obj)
{
if (typeof obj == "string")
{
« no previous file with comments | « no previous file | test/abp2blocklist.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld