use "normal" filters for element hiding

Everything about using Adblock Plus on Mozilla Firefox, Thunderbird and SeaMonkey
Post Reply
bur

use "normal" filters for element hiding

Post by bur »

While playing around with element hiding I came across some text-links that I removed by adding filters such as

Code: Select all

#a(href*=doubleclick)
#a(href*=falkag)
#a(href*=intellitxt)
Making a filter for all the adservices around would be quite some work and also somewhat redundant as my normal filterset already contained all those strings like "doubleclick" and "intellitxt". So I thought it'd be nice if ABP would automatically remove all <a>-elements with an href-attribut that fits any of the normal filters because then the element-filters above wouldn't be explecitly necessary and all text-links to well-known ad-servers would be removed. For example if you have "falkag", "fastclick" and "googleads" in your filterlist all links that have an href containing any of these strings would be hidden.

This could even be extended to all elements and all attributes so if someone has "doubleclick" as a filter it would automatically remove a <table class="doublick-ads"> or even a <form action="doubleclick.com/submit.php">. So it should remove a lot of elements related to advertising.

I hope I could make myself clear as I'm not a native english speaker, otherwise feel free to ask. :) But I think this feature would really improve ABP a lot.
User avatar
rick752
Posts: 2709
Joined: Fri Jun 09, 2006 7:59 pm
Location: New York USA
Contact:

Post by rick752 »

@ bur:

That's all a nice idea, but there are a few things wrong with its implementation:

First, those hides will only remove anything that is a "linked" item. The table itself, any other enclosures, any unlinked images, any background images/colors, and all of the unlinked text will NOT be removed. In many instances, the text ad would probably look even worse.

Second, most classes and id's are almost never named after their advertisers. They are selected as an ad spot and given a name by the web designer as a place to put an ad (those are the elements that we are looking for). Sometimes the designer does not even know who's ad is going in there .... that's usually up to the marketing department.
bur

Post by bur »

rick752 wrote:First, those hides will only remove anything that is a "linked" item. The table itself, any other enclosures,
True, that's why I said it probably should also applied to all other elements. So everything from links to paragraphs or headlines that has an attribute related to an advertiser will be removed.
Second, most classes and id's are almost never named after their advertisers.
I know, so the blocking should not only check for the class and id attribute, but for every attribute of every element. Like I said in my example, even a <form action="doubleclick.php">blabla</form> would be removed.

I'd like to know what Wladimir thinks about it as I believe that'd be a really nice feature.
Wladimir Palant

Post by Wladimir Palant »

I have to agree with Rick, this is usually not too useful. If you have an image ad, then "check banner links" in combination with "collapse blocked elements" will do. If it is a text ad - well, this won't be really helpful anyway.

Also, if I could use something like the "normal" filters for element hiding I would have done this long ago - unfortunately this doesn't seem possible. However, I certainly want an independent set of rules for element hiding - see my list of DIV blocking issues for more information.
bur

Post by bur »

If it is a text ad - well, this won't be really helpful anyway.
But why? My idea was that abp would remove that line of text just like it removes an image that links to a blocked site. Or isn't that possible for some reason?
Wladimir Palant

Post by Wladimir Palant »

If you have a text ad, you don't want to just remove the link - you want to remove the entire block (e.g. there might be text without a link on it). And removing a block by a link inside is can't be done with CSS, consequently it can't be done with element hiding - you have to specify the block's id/class.
bur

Post by bur »

Just removing the text-link would be better than nothing. Adblock only removes images and not the whole block they're placed in.
And removing a block by a link inside is can't be done with CSS, consequently it can't be done with element hiding
But why? (you see, I like that phrase ;)) Just because it can't be specified using CSS doesn't mean Adblock can't block it, or does it? Why can't ABP just detect the block the link to a filtered site is contained in and remove it?

For example, I have the filter "doubleclick.net" then Adblock would remove a construct like <div>Click below for great fun!<br><a href="doubleclick.net">CLICK!!!</a></div>

No special element filters would be neccessary as ABP would get the doubleclick-filter from the normal list. I still think that would help a lot in removing text ads like those that appear in google search results. Those'd be removed completely by that method.
steve

Post by steve »

1) adblock plus uses functions of firefox. and its simly not possible to tell firefox that he should remove something, because a comment, id or string matches a filter.
perhaps some filering proxies support this, but building it into firefox is a overkill. it would be slow and buggy, because you have to create a additional phraser...

2) this feature would cause more false positives than any other thing. sometimes whole articles/textpassages would dissapper. this would be uncontrolable.
bur

Post by bur »

@steve

1)Okay, I see.

2)That might be very well be true. But what about at least removing <a> elements that link to a blocked URL? That shouldn't cause any more false positives than the current <img> blocking and would be quite helpful (I know it won't remove most text ads complety but at least partly). Is it possible to tell Fx to remove a <a> based on the href-attribute?
User avatar
rick752
Posts: 2709
Joined: Fri Jun 09, 2006 7:59 pm
Location: New York USA
Contact:

Post by rick752 »

bur wrote:@steve

1)Okay, I see.

2)That might be very well be true. But what about at least removing <a> elements that link to a blocked URL? That shouldn't cause any more false positives than the current <img> blocking and would be quite helpful (I know it won't remove most text ads complety but at least partly). Is it possible to tell Fx to remove a <a> based on the href-attribute?
Well, I wouldn't expect that anyone doing any adblock support would ever want that, simply because if someone posts a link to a problem like a false-positive or somthing that YOU have blocked and they don't and want to know about it ... the link itself along with its encapsuled text would be totally invisible.

... and that was just a thought after reading this post. There would be other problems too. :wink:
bur

Post by bur »

But besides when reporting URLs I doubt there'll be problems with blocking <a>-elements. At least no more than with blocking <img>. And as it's the only practical way to block text-ads, I think it's worth this little problem.

Anyway, it looks like general consensus is that it's a bad idea, so I probably head off to the next library to get a copy of "How to become a Master Extensions Coder(tm) in 10 days" and make my very own Adblock++.
User avatar
Peng
Posts: 518
Joined: Fri Jun 09, 2006 8:14 pm
Location: Central Florida
Contact:

Post by Peng »

bur wrote:And as it's the only practical way to block text-ads, I think it's worth this little problem.
Many (dare I say "most"?) text ads can be better blocked by blocking the script that loads them or a parent div or table or something.. Am I missing something here?
Matt Nordhoff
Post Reply