help me getting my favorite newspage ad-free

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

help me getting my favorite newspage ad-free

Post by madperson »

principally i'm comfortable in element blocking ect., but this one is beyond my skills :))

basically the site uses code similar to this one to embed their ads:

Code: Select all

<div class="article">
<td class="adheadline">Here comes the headline of the ad</td>
Here is the actual content of the ad
</div>
i can't hide the div.article element, since all other legit editorial content on the page is embedded with the same class-attribute & filtering td.adheadline won't remove the actual content of the ad.
now, is there a way to block all div.article elements that contain the td.adheadline as child (as far as i know CSS selectors can only match the child of a certain parent but not the way round)?

so far i'm using the rip-extension for this job, which uses xpaths to hide objects (but it is quite unstable), but i'd rather use adblock to have all my filters in one place. if you want to see the actual source code site: it's derstandard.at & the ads, i'm talking about, are surrounded by "</ADVERTORIAL>"

i'd really appreciate any thoughts...
User avatar
rick752
Posts: 2709
Joined: Fri Jun 09, 2006 7:59 pm
Location: New York USA
Contact:

Post by rick752 »

I can only xpath to it too. Seems like the code is generated into ... or actually written in the html itself.

On the home page:

Code: Select all

derstandard.at##div.innertd.mobj:first-child + div.spacernew + div.innertd.mobj + div.innertd.mobj
... removes the ad on the left (3rd box down). I can't find an easier way. But if the code is not dynamic, that should always be the same unless someone rewrites the layout of that page each time.

ps: You can't block an outer element in ABP by using its child info.
madperson

Post by madperson »

thanks a lot, that was exactly what i was searching for :))
User avatar
rick752
Posts: 2709
Joined: Fri Jun 09, 2006 7:59 pm
Location: New York USA
Contact:

Post by rick752 »

Have you tried using the ABP Element Hiding Helper add-on?
https://addons.mozilla.org/en-US/firefox/addon/4364

You can use it to x-path from the target-upward. It takes a little practice but works great ... generates and adds the code to ABP automatically.

Sometimes for more tricky things, I use Firebug to do an "in-depth" analyzing of the elements ... and then I use EHH to implement and generate the ABP code. Firebug shows much more info when you NEED to see more.
guesty

Post by guesty »

This kind of situation is what makes using the Stylish extension superior to adblock plus's element hiding.

Code: Select all

@-moz-document domain(derstandard.at) {
.adheadline, * > .adheadline { display: none !important;}
}
Locked