An element rule does not want to be elementrule

Posting here is no longer possible, please use the forum of a filter list project, such as EasyList
Locked
adblock plus fan

An element rule does not want to be elementrule

Post by adblock plus fan »

I'm new to this forum and trying to learn more about adblock.
Image
Can someone explain the above?
With this rule I'm trying to hide the uppermost frame on pages like this: http://img408.imageshack.us/my.php?image=adblockli7.png
While at the same time I wish to whitelist a frame with "id=scalewarning" from same domain.
The problem is as shown in picture, it does not want to be listed under element hiding rules for some reason.
But if I rename the rule and add a second # like this: imageshack.us##DIV:not(id=scalewarning)(align=center)
Then it is accepted as element hiding rule, but this method will not work as intended.
What should I do?
User avatar
Stupid Head
Posts: 214
Joined: Sat Aug 26, 2006 8:11 pm
Location: USA

Post by Stupid Head »

Using raw CSS or putting "##" means that you have the CSS syntax and not the special Adblock Plus syntax. So something like this should work:

Code: Select all

imageshack.us##div:not([id="scalewarning"][align="center"])
Because elements with an id attribute must be unique, the following can be used if the page follows standards.

Code: Select all

imageshack.us##div:not(#scalewarning)
What, me worry?
adblock plus fan

Post by adblock plus fan »

Stupid Head wrote:Using raw CSS or putting "##" means that you have the CSS syntax and not the special Adblock Plus syntax.
I didn't understand that, but that's my fault for not understanding enough programming.:oops:
Thank you for the explanation.
Stupid Head wrote:Because elements with an id attribute must be unique, the following can be used if the page follows standards.

Code: Select all

imageshack.us##div:not(#scalewarning)
Excellent! This works well and looks much cleaner. Instead of blocking DIV with "align=center", we can just block any DIV, good idea.
adblock plus fan

Post by adblock plus fan »

Stupid Head wrote:

Code: Select all

imageshack.us##div:not(#scalewarning)
Okay I have a new problem. Your filter works perfectly for pages such as this: http://img408.imageshack.us/my.php?image=adblockli7.png
But the main page itself has a problem: http://imageshack.us/
Main page has a vital upload function which unfortunately falls under DIV.
Image
So what I specifically need is to
block all DIV(align=center)
but spare DIV(id=scalewarning)

Is there a filter possible for this?
Stupid Head wrote:So something like this should work:

Code: Select all

imageshack.us##div:not([id="scalewarning"][align="center"])
Unfortunately this method does not work for me at all.
Wladimir Palant

Post by Wladimir Palant »

Code: Select all

imageshack.us##div[align="center"]:not(#scalewarning)
This should work.
adblock plus fan

Post by adblock plus fan »

Wladimir Palant wrote:

Code: Select all

imageshack.us##div[align="center"]:not(#scalewarning)
This should work.
Yes that works! Thank you!

The :not() function is certainly useful it seems. :D
Locked