LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   My Konqueror ad blocker (allso firefox, opera etc) (https://www.linuxquestions.org/questions/linux-networking-3/my-konqueror-ad-blocker-allso-firefox-opera-etc-282846/)

cadj 01-27-2005 08:23 AM

My Konqueror ad blocker (allso firefox, opera etc)
 
Spent some time today researching/making this. Seems to work very well for me so far.

Works with Konqueror, Firefox, IE, Opera and mayb others

This file will block a wide range of adverts. Its very easy to install and very easy to customize!

To use the file,

1) copy and paste the below code into a "proxy.pac" file.
2) Configure your browsers proxy settings to use a proxy configuration URL (select the proxy.pac file)
3) Start browsing and you will notice many banner ad's are gone!


Code:

    function FindProxyForURL(url, host)
    {
  if (      shExpMatch(host, '*.ad*')
  || shExpMatch(host, '*.ads*')
  || shExpMatch(host, '*banners*')
  || shExpMatch(host, '*doubleclick*')
  || shExpMatch(host, '*googlesyndication*') 
  ) 
  return "PROXY 0.0.0.0:8000;";
 else
    return "DIRECT";
    }


This script works by checking all url's coming into your browser, if the url contains the word "banners", the script tells your browser to use a proxy that dosent exist.

I have my PROXY point to a webserver (xx.xx.xx.xx:80) where the index.htm page is transparent, this removes any errors you see in place of the adds.

WARNING:
Don't put in too many filters, as a large list does slow you down, however i notice no difference with the defaults.


Hope this is of use :)

static_drc 03-17-2005 07:58 PM

First of all, I love you.

Second of all, could you please write a bit more on how to have the proxy point to a blank index.html file, so that I don't have to see "An error occurred while loading..." messages?

Thank you so much!

XavierP 03-18-2005 01:41 AM

To preserve this for posterity, could I ask that you submit it to our Tutorials section - suitably fleshed out, of course. Otherwise, it may get lost among the other threads.

cadj 03-18-2005 05:20 AM

ill get to work on a tutorial, covering the use of thttpd to take care of the error messages, ill post back here when its up


All times are GMT -5. The time now is 08:35 PM.