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

Unified Diff: lib/abp2blocklist.js

Issue 29451555: Noissue - Always add HTTP(S) prefix to URL unless anchored (Closed) Base URL: https://hg.adblockplus.org/abp2blocklist
Patch Set: Created May 30, 2017, 6:35 a.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/abp2blocklist.js
===================================================================
--- a/lib/abp2blocklist.js
+++ b/lib/abp2blocklist.js
@@ -250,17 +250,17 @@
// further rules for it, but if not we can simply return now.
if (!(filter.contentType & whitelistableRequestTypes))
return;
}
let trigger = {"url-filter": parsed.regexp};
// Limit rules to HTTP(S) URLs
- if (!/^(\^|http)/i.test(trigger["url-filter"]))
+ if (!/^\^/.test(trigger["url-filter"]))
trigger["url-filter"] = "^https?://.*" + trigger["url-filter"];
// For rules containing only a hostname we know that we're matching against
// a lowercase string unless the matchCase option was passed.
if (parsed.canSafelyMatchAsLowercase && !filter.matchCase)
trigger["url-filter"] = trigger["url-filter"].toLowerCase();
if (parsed.canSafelyMatchAsLowercase || filter.matchCase)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld