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

Unified Diff: lib/filterClasses.js

Issue 29876561: Issue 6931 - Allow content filters for localhost (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Cover ~www.localhost,localhost case Created Sept. 10, 2018, 9:40 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 | test/filterClasses.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/filterClasses.js
===================================================================
--- a/lib/filterClasses.js
+++ b/lib/filterClasses.js
@@ -1126,17 +1126,18 @@
if (type == "@")
return new ElemHideException(text, domains, body);
if (type == "?" || type == "$")
{
// Element hiding emulation and snippet filters are inefficient so we need
// to make sure that they're only applied if they specify active domains
- if (!/,[^~][^,.]*\.[^,]/.test("," + domains))
+ if (!(/,[^~][^,.]*\.[^,]/.test("," + domains) ||
+ /,localhost,/.test("," + domains + ",")))
Sebastian Noack 2018/09/10 17:44:37 It seems we don't need a regular expression here,
Manish Jethani 2018/09/10 17:57:32 Good point, done.
{
return new InvalidFilter(text, type == "?" ?
"filter_elemhideemulation_nodomain" :
"filter_snippet_nodomain");
}
if (type == "?")
return new ElemHideEmulationFilter(text, domains, body);
« no previous file with comments | « no previous file | test/filterClasses.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld