Using Regular Expressions to remove portions of page source
Posted: Wed Oct 17, 2007 4:09 am
Ok, I'm pretty sure there's no way to do this with Adblock Plus, but I figure it doesn't hurt to ask.
What I am trying to do is have all instances of a certain regular expression removed from the page source. I'm aware of element hiding, but element hiding doesn't quite get me what I need, since I'm not able to make conditions on the content outside of the element declaration.
For example, what I want to block looks like this:
Is there any way to do this with Adblock Plus? If not, does anyone know of any other extension that allows this sort of thing?
Thanks!
What I am trying to do is have all instances of a certain regular expression removed from the page source. I'm aware of element hiding, but element hiding doesn't quite get me what I need, since I'm not able to make conditions on the content outside of the element declaration.
For example, what I want to block looks like this:
But I don't want to block all elements of class "message," just the ones that have an image with alt="blah". I've got a regular expression that finds the content consistently, but Adblock only seems to apply regular expressions to the URL.<div class="message"><img src="asdf.jpg" alt="blah" />blah blah blah</div>
Is there any way to do this with Adblock Plus? If not, does anyone know of any other extension that allows this sort of thing?
Thanks!