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

Unified Diff: lib/abp2blocklist.js

Issue 29349981: Noissue - Remove rules which match no resource types (Closed)
Patch Set: Remove redundant comment, use simpler test filters Created Aug. 22, 2016, 12:43 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
diff --git a/lib/abp2blocklist.js b/lib/abp2blocklist.js
index 0309dd21bc22fce2d68f896028bfba32c5d2715a..e9bbd1c00ef7826b4b6b0ad48ed12d7889c8a527 100644
--- a/lib/abp2blocklist.js
+++ b/lib/abp2blocklist.js
@@ -273,7 +273,13 @@ function convertFilterAddRules(rules, filter, action, withResourceTypes)
parseDomains(filter.domains, included, excluded);
if (withResourceTypes)
+ {
trigger["resource-type"] = getResourceTypes(filter);
+
+ if (trigger["resource-type"].length == 0)
+ return;
+ }
+
if (filter.thirdParty != null)
trigger["load-type"] = [filter.thirdParty ? "third-party" : "first-party"];
« 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