in reply to Pop-up killing http proxy

Where is a good Perlish starting point for building an http proxy which would filter out ads by rewriting Javascript on the fly and removing all Flash?

Rewriting JavaScript on the fly is going to be quite literally impossible to get right. You might as well just strip it out. Of course, there's no reason not to just turn it off in your browser.

There are other ways to avoid the bulk of nuisance ads. One easy trick that you can use is to put fake entries in your hosts table for sites that serve them. This is especially useful for those that have chaining pop-ups and pop-unders where another one opens up as soon as you close one.

-sauoq
"My two cents aren't worth a dime.";

Replies are listed 'Best First'.
Re: Re: Pop-up killing http proxy
by Stegalex (Chaplain) on Sep 02, 2002 at 19:12 UTC
    True, I can turn off Javascript but then a lot of things won't work properly. Stripping out selective Javascript and Applet tags would be a good start I suppose. I am intrigued by what you said about the hosts table. Is this something I can do on a Windows box?

    ~~~~~~~~~~~~~~~
    I like chicken.

      Under WINNT/WIN2K/WINXP the hosts file is located in

      %systemroot%\system32\drivers\etc\hosts

      Try this search to find more info on setting it up and also pre-configured hosts files for blocking server known to serve pop-up adds. Beware, they can get pretty big. Mine is currently 450k or near 12500 lines. This does not seem to have any noticable effect on my browsing, but others have reported some degradation.

      I haven't seen a pop-up for ... well, a long, long time.

      Then again, I don't have js enabled except for specific sites and Opera 6 has a built-in pop-up refusal option too.

      As my Dad would have said. "A belt and braces man".

      Also, I have no knowledge of the one you mentioned, but in the past I used an ad blocking proxy that seemed fairly effective called Proxomitron, which has some pretty nifty features, regex search and replace etc, but the maintainence was quite high. The hosts file solution is infinitly better.


      Well It's better than the Abottoire, but Yorkshire!

      Yes, you can. Take a look at c:\windows\hosts.sam.

      Create a file called c:\windows\hosts and insert a line like

      127.0.0.1       spammer.com
      

      to block the domainname spammer.com. Incidentially, you can even add

      127.0.0.2       project1
      127.0.0.3       project2

      and configure a webserver (e.g. apache) to run on these adresses, and you'll have a nice way to test-drive your websites, if you develop any.