In current easylist, this rule makes no sense

Posting here is no longer possible, please use the forum of a filter list project, such as EasyList
Locked
TechnikEmpire
Posts: 8
Joined: Wed Dec 17, 2014 10:14 am

In current easylist, this rule makes no sense

Post by TechnikEmpire »

/[a-zA-Z0-9]+\.[a-z]+\/.*(?:[!"#$%&'()*+,:;<=>?@/\^_`{|}~-]).*[a-zA-Z0-9]{4}/$third-party,xmlhttprequest,domain=~phncdn.com|pornhub.com|redtube.com|youporn.com

This rule makes no sense. The formatting with the $domain option explicitly binds this rule to function on pornhub.com|redtube.com|youporn.com. The domain flag, though the docs don't say so, can only logically function in a binary fashion. By specifying a domain exception ("~") followed by domain inclusion, the exception is redundant and irrelevant and should throw an error on parsing, because by applying the domain option with inclusion domains, you're automatically making all other domains an exception to this rule.

Can someone please confirm or deny if there is some sort of really bad logic in ABP itself that will actually accept this rule? Or does it the engine simply ignore the exception domain? Or worse yet, does the engine just, in a buggy way, eat up this rule and bug out by applying this filter to all domains except for phncdn.com? If I'm correct with my logic here, then the docs and the syntax should be updated to:

$~domain=
$domain=

Hope someone can shed some light or confirm my suspicions here. It's really difficult to contribute when you've got to unlearn everything you've ever learned about structure, syntax, order of operations and basic logic just to start to try to understand the filtering syntax in this engine.
User avatar
mapx
Posts: 21940
Joined: Thu Jan 06, 2011 2:01 pm

Re: In current easylist, this rule makes no sense

Post by mapx »

from en/filters#options
For example, domain=~example.com means that the filter should be applied on pages from any domain but "example.com" and domain=example.com|~foo.example.com restricts the filter to the "example.com" domain with the exception of "foo.example.com" subdomain.
User avatar
mapx
Posts: 21940
Joined: Thu Jan 06, 2011 2:01 pm

Re: In current easylist, this rule makes no sense

Post by mapx »

see also en/filter-cheatsheet

domain= Specify a list of domains, separated by bar lines (|), on which a filter should be active. A filter may be prevented from being activated on a domain by preceding the domain name with a tilde (~).
TechnikEmpire
Posts: 8
Joined: Wed Dec 17, 2014 10:14 am

Re: In current easylist, this rule makes no sense

Post by TechnikEmpire »

Thanks maxp for the reply. I'm still confused though. From your quote:
and domain=example.com|~foo.example.com restricts the filter to the "example.com" domain with the exception of "foo.example.com" subdomain.
So does this mean that the filter applies to both example.com and foo.example.com? Why wouldn't the filter simply be written as "$domain=example.com|foo.example.com"?

Or does this mean that the filter stops functioning while within the subdomain? Sorry, the ambiguity of English > ambiguity of these rules. :)
TechnikEmpire
Posts: 8
Joined: Wed Dec 17, 2014 10:14 am

Re: In current easylist, this rule makes no sense

Post by TechnikEmpire »

mapx wrote:see also en/filter-cheatsheet

domain= Specify a list of domains, separated by bar lines (|), on which a filter should be active. A filter may be prevented from being activated on a domain by preceding the domain name with a tilde (~).
Right but still my question remains. example.com is not the same host as foo.example.com, so it seems redundant to specify the exception here. The filter is bound to example.com, so whilst on foo.example.com, the filter shouldn't (by what I can see) trigger anyway.
User avatar
mapx
Posts: 21940
Joined: Thu Jan 06, 2011 2:01 pm

Re: In current easylist, this rule makes no sense

Post by mapx »

back to your question
domain=~phncdn.com|pornhub.com|redtube.com|youporn.com

indeed ~phncdn.com makes no sense here

it is useful only when you want to exclude a subdomain
domain=~sub.pornhub.com|pornhub.com|redtube.com|youporn.com
TechnikEmpire
Posts: 8
Joined: Wed Dec 17, 2014 10:14 am

Re: In current easylist, this rule makes no sense

Post by TechnikEmpire »

mapx wrote:back to your question
domain=~phncdn.com|pornhub.com|redtube.com|youporn.com

indeed ~phncdn.com makes no sense here

it is useful only when you want to exclude a subdomain
domain=~sub.pornhub.com|pornhub.com|redtube.com|youporn.com
Thanks for the response. I thought I scarred you off. :) lol thanks again for the clarification. Are you a dev or something?
User avatar
mapx
Posts: 21940
Joined: Thu Jan 06, 2011 2:01 pm

Re: In current easylist, this rule makes no sense

Post by mapx »

moderator.
Anyway I posted on easylist forum about your question
https://forums.lanik.us/viewtopic.php?f=64&t=21950
Locked