Page 1 of 1

Block div containing text/link?

Posted: Mon Mar 07, 2011 7:51 pm
by her34
Is it possible to block an element based on text contained within it?

For example on this website:
http://videosift.com/

I'd like to block certain types of videos.

This rule:

Code: Select all

videosift.com##DIV.sift
blocks all of them which is too much.


So if i got sick of charlie sheen videos i wish i could put something like

Code: Select all

videosift.com##DIV.sift//a[(text()="charlie sheen")]

Re: Block div containing text/link?

Posted: Mon Mar 07, 2011 10:52 pm
by Ares2
her34 wrote:Is it possible to block an element based on text contained within it?
Unfortunately, that's not possible with Adblock Plus.

Re: Block div containing text/link?

Posted: Tue Mar 08, 2011 12:20 pm
by LorenzoC
In ABP you have two kind of rules.

Blocking rules aim the URL of external objects. Like the site loads a banner from the adserver "ad.example.com" and the rule will be something like ||example.com^ or .example. Anything that comes from an URL containing the keyword ".example." will be blocked.

Element Hiding rules aim to HTML elements using CSS selectors or inheritance. Like your videosift.com##DIV.sift rule above. This rule DOES NOT BLOCK, it hides all the DIVs whose CLASS is "sift", by changing their CSS "display" property.