Privoxy gurus?

Zear
09-15-2006, 12:06 PM
Can anyone give me the short answer on how to substitute a local image for a specific image on a remote site using Privoxy? I know it is possible, I just can't seem to wrap my head around parts of the Privoxy config files...

Zear
09-15-2006, 03:14 PM
Nevermind. I figured it out:

In config.txt, uncomment this:

#filterfile default.filter

so that it becomes:

filterfile default.filter

In default.filter, add:

FILTER: image-substitution Substitute local images for remote ones

s|match|new|sigU

where 'match' is the image's URL, and 'new' is the replacement URL. Don't forget to escape periods. For instance, to replace the small TW banner (header2_mid_logo.jpg):

FILTER: image-substitution Substitute local images for remote ones

s|http://images\.tribalwar\.com/tribalwar/forums/misc/header2_mid_logo\.jpg|fil e:///D:/media/Images/newtwbanner\.gif|sigU

In user.action, add this to the end:

+filter{ image-substitution }
/

Save all files and restart privoxy.

-------------------

Now the only problem appears to be with Firefox's ability to load local images. If I do the above, anywhere in the source of any page where "http://images.tribalwar.com/tribalwar/forums/misc/header2_mid_logo.jpg" appears, it will be changed to "file:///D:/media/Images/newtwbanner.gif". If I put that local image URL into the address bar of FF it loads the image just fine, but if the same string is used in the SRC field of an IMG tag, it is not loaded for a remote page. It will be loaded if the html file is loaded from a local file however. WTF? I must be missing something stupid here...