Can someone point me at a more complete syntax for filter writing documentation, specifically for element hiding? "Writing Adblock Plus filters" is very terse and only provides brief examples.
I am trying to block this div:
<div style="float: left; text-align: center; background-color: #fff; border: 1px solid #ccc; width: 364px;">
I could use this filter:
#div(style*=width:364px)
but then I block all 364 pixel wide divs.
Based on the documentation it seems like this ought to work too:
#div(style*=width:364px)(style*=text-align: center)
but it doesn't. I thought you could have multiple criteria and they would be ANDed together?
This doesn't work either:
#div(style*=background-color: #fff)
maybe because of the # before fff? Is there a way to escape the #?
is there more detailed filter writing documentation?
Element Hiding Helper extension should help - it makes writing element hiding filters much easier. See http://adblockplus.org/en/elemhidehelper#using
Your filters don't work because the style attribute is "special" - it is rewritten when the browser displays the page. So what you should hide is:
That's also something Element Hiding Helper solves - it works on the current state of the web page rather than the source code.
Your filters don't work because the style attribute is "special" - it is rewritten when the browser displays the page. So what you should hide is:
Code: Select all
<div style="border: 1px solid rgb(204, 204, 204); float: left; text-align: center; background-color: rgb(255, 255, 255); width: 364px;">
Hrm. I'm willing to believe that the underlying representation of the web page is as you say it is, with the rewritten style attribute and your code sample, but I'm still not sure how to translate that into an actual rule. Any attempts to put that entire style rule (with semicolons and parentheses etc.) cause the "Add filter" dialog to think I am entering an Advertisement filter, not an Element hiding rule. So clearly there is some syntactical foul-up going on.
I'd rather not use the extension -- I'm a do-it-yourselfer and even if the extension would help I'd still like to see a more detailed description of the rule syntax
I'd rather not use the extension -- I'm a do-it-yourselfer and even if the extension would help I'd still like to see a more detailed description of the rule syntax
