Using Regular Expressions to remove portions of page source

Everything about using Adblock Plus on Mozilla Firefox, Thunderbird and SeaMonkey
Post Reply
RandomBlogger

Using Regular Expressions to remove portions of page source

Post by RandomBlogger »

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:
<div class="message"><img src="asdf.jpg" alt="blah" />blah blah blah</div>
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.

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!
User avatar
Peng
Posts: 518
Joined: Fri Jun 09, 2006 8:14 pm
Location: Central Florida
Contact:

Post by Peng »

You can run a local proxy program like, erm, Proxomitron, or that other one.
Matt Nordhoff
JDlugosz
Posts: 7
Joined: Fri Nov 10, 2006 9:03 pm
Contact:

Re: Using Regular Expressions to remove portions of page sou

Post by JDlugosz »

RandomBlogger wrote: If not, does anyone know of any other extension that allows this sort of thing?

Thanks!
Yes in deed! Do it with Greasemonkey.
You can specify that rule as an XPATH expression, and delete the element you found, render it invisible, replace it with something else, or whatever.
User avatar
Peng
Posts: 518
Joined: Fri Jun 09, 2006 8:14 pm
Location: Central Florida
Contact:

Post by Peng »

If it's XPATH, isn't that what Remove It Permanently for?
Matt Nordhoff
User avatar
cuzz
Posts: 30
Joined: Thu Oct 11, 2007 3:59 am
Location: redwood deck
Contact:

Post by cuzz »

if put in the public sphere
I choose whether to look at it...
or NOT
Post Reply