Blocking Advertisements on similar domain name?

Posting here is no longer possible, please use the forum of a filter list project, such as EasyList
Locked
fenslett
Posts: 2
Joined: Mon Jan 25, 2016 6:43 am

Blocking Advertisements on similar domain name?

Post by fenslett »

Hey guys.
I'm just wondering about how to hide/block ads on the specific domain name that kees changing constantly like this:
domain1.com/img/ad.jpg
domain2.com/img/ad.jpg
domain.co.ca/img/ad.jpg
... and so on.

EDIT :
I don't know why, but not only ccTLD and gTLD but also its domain name keep changing once every two weeks.
Is there any way to block them at a time?
Last edited by fenslett on Wed Mar 02, 2016 3:49 pm, edited 1 time in total.
User avatar
mapx
Posts: 21940
Joined: Thu Jan 06, 2011 2:01 pm

Re: Blocking Advertisements on ever-changing domain name?

Post by mapx »

provide the real example and explain what elements you want to block / hide
lewisje
Posts: 2743
Joined: Mon Jun 14, 2010 12:07 pm

Re: Blocking Advertisements on ever-changing domain name?

Post by lewisje »

fenslett wrote:I know I can use the caret symbol(^) to make a rule that embraces different country domain suffixes as in domain^ to block domain.com and domain.co.ca.
No you can't: filters#separators
There's a buzzin' in my brain I really can't explain; I think about it before they make me go to bed.
fenslett
Posts: 2
Joined: Mon Jan 25, 2016 6:43 am

Re: Blocking Advertisements on ever-changing domain name?

Post by fenslett »

mapx wrote:provide the real example and explain what elements you want to block / hide
Sorry for the confusion and late response.
I want to block ads on similar domain name:
  • domain1.com/img/ad.jpg
    domain2.com/img/ad.jpg
    domain.co.ca/img/ad.jpg
    ... and so on.
I made a rule manually whenever the domain name changed, but it was quite irritating stuff.
So, I tried to find how to block ads on those domain in one line, however I couldn't.
lewisje
Posts: 2743
Joined: Mon Jun 14, 2010 12:07 pm

Re: Blocking Advertisements on similar domain name?

Post by lewisje »

That's not "the real example": You just re-stated the OP.

There is no wildcard for public suffixes in hiding rules, unfortunately; now for the part of the domain that changes, you might try a regex filter:

Code: Select all

/^http(?:s)?\:\/\/(?:[-\w][-\w]*\.)*domain\d*(?:\.[-a-z]*)(?:\.[-a-z]*)?(?:\:\d\d{,4})?\/img\/ad\.jpg(?!\w)/
I used a couple of optimizations here: Instead of the + (one or more) modifier, I used the pattern and then followed it with the * (zero or more) modifier (and I did something similar with what would normally be the {1,5} modifier); also, I made sure to use non-capturing groups throughout.
There's a buzzin' in my brain I really can't explain; I think about it before they make me go to bed.
Locked