Page 1 of 1

How to Hide HTML enclosed in Start & End comments

Posted: Tue Oct 23, 2007 6:10 am
by user6300
Hi,

First let me thank the developers for having such an amazing addon. Cheers.

I have been using abp since a while now. learning to start developing / writing filters. my first attempt is to hide HTML enclosed in comments. some thing like

<!-- custom block start -->
<some HTML Code>
<!-- custom block end -->

Here is the block that I want to hide completely.

Code: Select all

<!-- custom block start -->
<table class="tborder" align="center" border="0" cellpadding="6" cellspacing="1" width="100%">
<tbody>
<tr>
<td class="tcat">
<!-- title start -->

<!-- title end -->
</td>
</tr>
<tr>
<td class="alt2">
<!-- code start -->
<center><a style="display: none;" href="http://www.someforum.com/OpenAds/adclick.php?bannerid=17&zoneid=2&source=&dest=http%3A%2F%2Fwww.berkeleypoint.com%2Findex.html" target="_blank"><img style="display: none;" src="http://www.someforum.com/OpenAds/adimage.php?filename=bp_banner.jpg&contenttype=jpeg" alt="Berkeley Point" title="Berkeley Point" border="0" height="72" width="468"></a><div id="beacon_17" style="position: absolute; left: 0px; top: 0px; visibility: hidden;"><img src="http://www.someforum.com/OpenAds/adlog.php?bannerid=17&clientid=4&zoneid=2&source=&block=0&capping=0&cb=f0e51c5961a82bbeaeda4db22af810c6" alt="" style="width: 0px; height: 0px; display: none;" height="0" width="0"></div></center>
<!-- code end -->
</td>
</tr>
</tbody>
</table>
<br>
<!-- custom block end -->

Posted: Tue Oct 23, 2007 9:44 am
by Wladimir Palant
Adblock Plus is not filtering HTML, so you will not be able to block anything "between this and this HTML code". But you should be able to hide this table with element hiding rules. You might want to try this rule:

Code: Select all

site.com#table(class=tborder)(align=center)(cellpadding=6)
site.com has to be replaced by the domain name of the site where you want to apply this rule. Only problem: if there are other tables with the same attributes, they will be hidden as well. So the rule above is only useful if the combination |class="tborder" align="center" cellpadding="6"| is unique. If not - try to find something that *is* unique. We cannot help you with this without seeing the site.

For reference: http://adblockplus.org/en/filters#elemhide_basic

Posted: Wed Oct 24, 2007 2:34 pm
by user6300
Hi,

Thank you very much for the reply. I had already gone through the reference.... but couldn't figure out how to do that.... Also in future, will there be such a feature added? i.e. hiding elements between a set of HTML code. it would make things a lot simpler.

The elements that that I want to hide are in footer and some of the header. you will immediately know what i mean if you visit ....

http://www.candlepowerforums.com/vb/ :D

The Site Admin simply wasting space the precious screen space. and loads of images are just disturbing the main mission of the site.

Currently I have following filters the filter you suggested didn't work :( .. please help...
[Adblock]
candlepowerforums.com#table[class=tborder][align=center][cellpadding=6]
http://www.candlepowerforums.com/goldfinger.gif
http://www.candlepowerforums.com/Support.gif
http://www.candlepowerforums.com/Login.gif
http://www.candlepowerforums.com/rules.gif
http://www.candlepowerforums.com/faqs.gif
http://www.candlepowerforums.com/ug1.gif
http://www.candlepowerforums.com/mp1.gif
http://www.candlepowerforums.com/EDC.gif
http://www.candlepowerforums.com/Classifieds/*
http://www.candlepowerforums.com/newtitle.gif
http://www.cpfmarketplace.com/go-maet1.gif
http://www.candlepowerforums.com/Classifieds.gif

Posted: Thu Oct 25, 2007 10:00 am
by Wladimir Palant
Sorry, my filter used wrong brackets - I fixed that in the post above.
Also in future, will there be such a feature added? i.e. hiding elements between a set of HTML code. it would make things a lot simpler.
HTML code is often dynamic and I think that working with it after it has been parsed/changed is the more promising approach. Anyway, a feature to "filter HTML" would work on a much lower level than the rest of Adblock Plus - meaning that I am very unlikely to add it. There are already solutions in this area that work quite well (e.g. Proxomitron).

Posted: Sat Nov 03, 2007 11:39 pm
by me
In additions to the above, i also add this filter:
http://www.candlepowerforums.com/OpenAds/*

That'll block the annoying ads smack in the middle.