Filtering parent elements by finding their children.

Everything about using Adblock Plus on Google Chrome

Filtering parent elements by finding their children.

Postby WithMetta » Thu May 24, 2012 11:27 pm

Code: Select all
<div>
   <a href="adspam.com"> <--- What I use to find the ad
   <p>Crap text I don't want to see</p>
</div>


Anyway I could hide the parent div?
WithMetta
 
Posts: 1
Joined: Thu May 24, 2012 11:23 pm

Re: Filtering parent elements by finding their children.

Postby mapx » Fri May 25, 2012 12:13 am

if your site is example.com, try:

example.com##a[href*="adspam.com"]
User avatar
mapx
 
Posts: 21733
Joined: Thu Jan 06, 2011 3:01 pm

Re: Filtering parent elements by finding their children.

Postby lewisje » Fri May 25, 2012 10:33 pm

^That's not what the OP wanted exactly...

Anyway, you can't do what you're asking about until the following CSS4 feature is implemented: http://www.w3.org/TR/selectors4/#subject
Once it is, you can use something like example.com##$div>a[href*="adspam.com"] where the $ indicates the element to actually apply the CSS to.

In the meantime, you can use mapx's rule along with the following: example.com##a[href*="adspam.com"]+p
This rule hides all p elements adjacent to a elements with href containing "adspam.com"; mapx's rule hides those a elements.
There's a buzzin' in my brain I really can't explain; I think about it before they make me go to bed.
lewisje
 
Posts: 2743
Joined: Mon Jun 14, 2010 12:07 pm

Re: Filtering parent elements by finding their children.

Postby Zlatin Zlatev » Wed Oct 22, 2014 5:21 pm

If all your other divs on page have class or id, you could filter them out like

Code: Select all
div:not([class]):not([id])


It is not quite you want, but this worked for me in one particular overlay div case
Zlatin Zlatev
 

Re: Filtering parent elements by finding their children.

Postby myname » Fri Dec 16, 2016 2:59 pm

how do i block this whole element when there is "PROMO" as marked on the picture
Image
myname
 
Posts: 1
Joined: Fri Dec 16, 2016 2:53 pm

Re: Filtering parent elements by finding their children.

Postby mapx » Fri Dec 16, 2016 3:16 pm

you cannot do it, work in progress ..
User avatar
mapx
 
Posts: 21733
Joined: Thu Jan 06, 2011 3:01 pm


Return to Adblock Plus for Chrome support

Who is online

Users browsing this forum: No registered users and 7 guests