# vs ## vs ###

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

# vs ## vs ###

Post by General »

As title, what are the differences?

As examples:
#a(href^=http://adserver.com/)
##[class*="GoogleAds"]
###AdCol

I believe ### is redundant. ##ADCol and ###AdCol is the same isn't it?
Ares2
Posts: 1275
Joined: Fri Feb 15, 2008 12:47 pm

Re: # vs ## vs ###

Post by Ares2 »

# -> simple hiding rule, ABP syntax, with () around attribute selectors
## -> regular css syntax

and # is the id selector in css, so the rule ##[id="AdCol"] can also be written as ###AdCol
General

Re: # vs ## vs ###

Post by General »

Ares2 wrote:# -> simple hiding rule, ABP syntax, with () around attribute selectors
## -> regular css syntax

and # is the id selector in css, so the rule ##[id="AdCol"] can also be written as ###AdCol
So basically they are all the same
#(id=AdCol)
#*(id=AdCol)
##[id="AdCol"]
##*[id="AdCol"]
###AdCol
##*#AdCol

Which syntax should I use? Which is more efficient or run faster?

Why do we create different syntax (#(id=), ##[id=""], ###id) if they do the same thing?
Wladimir Palant

Post by Wladimir Palant »

Use this one:

Code: Select all

###AdCol
Or, if you want it a little more readable:

Code: Select all

##*#AdCol
The "simplified" syntax #(id=AdCol) is only kept for backwards compatibility, next version of Element Hiding Helper won't create such filters any more. And handling of [id="AdCol"] in the browser is likely slower than #AdCol (I didn't measure that however).
General

Post by General »

Thanks.

This document is very outdated: http://adblockplus.org/en/filters . It is still teaching beginners how to use the old syntax.

Is there any updated document for the CSS-syntax filters?
Wladimir Palant

Post by Wladimir Palant »

General

Post by General »

The only thing is to say CSS selector starts with ##.
Everything above is to tell people how to use the outdated ABP syntax. This is why I got confused initially. Some serious updates should be made.
General

Post by General »

What CSS version does Adblock Plus support?
Wladimir Palant

Post by Wladimir Palant »

Adblock Plus doesn't process CSS, Firefox does. Firefox currently supports all CSS2 selectors and some from CSS3.
Locked