Element hiding with exceptions

Posting here is no longer possible, please use the forum of a filter list project, such as EasyList
Locked
xteemu
Posts: 3
Joined: Sat Jun 09, 2007 2:00 pm

Element hiding with exceptions

Post by xteemu »

I'm trying to hide elements with #div(id*=ad) except elements with #div(id*=head) and #div(id*=advanced).

Is there a way of specifying a 'not containing' somehow?

It would be nice to get rid of the ads only, not the headers or the most interesting stuff of the page.

Otherwise like Adblock Plus a lot.
User avatar
rick752
Posts: 2709
Joined: Fri Jun 09, 2006 7:59 pm
Location: New York USA
Contact:

Post by rick752 »

Ouch ... do NOT use
#div(id*=ad)
... it will kill your blocking.

That will block ANYTHING that contains just the 2 letters "ad" ANYWHERE in the name (headline, header, LeadStory, etc). Very bad.
xteemu
Posts: 3
Joined: Sat Jun 09, 2007 2:00 pm

Post by xteemu »

Well, the pages I'm trying to clean up contain id=containerAdLeft, frameCenterAd, and others like that. I'd sure like to shake the creators hand for such a wide diversity.
I'm still going to approach the blocking with such a definition, if I only can enter the 'but not' part. Is it possible?

e.g.

somewhere.com#div(id*=ad)(id*!=head)(id*!=advanced)
User avatar
chewey
Posts: 501
Joined: Wed Jun 14, 2006 10:34 pm
Location: somewhere in Europe

Post by chewey »

Ah, this is possible:

Code: Select all

somewhere.foo##div[id*="ad"]:not([id*="head"]):not([id*="advanced"])
But it is important to use a domain name in front of this rule. Without it, this would be way too generic.
User avatar
rick752
Posts: 2709
Joined: Fri Jun 09, 2006 7:59 pm
Location: New York USA
Contact:

Post by rick752 »

That is very cool chewey. I never thought of using that type of 'multiples' using the ":not" definer.

A very interesting string example. :idea:
xteemu
Posts: 3
Joined: Sat Jun 09, 2007 2:00 pm

Post by xteemu »

Thanks. Works exactly as I wished.
Locked