<head><title>Bust Banner Ads with Proxy Auto Config</title></head>
<meta name="keywords" content="block eliminate remove banner ads advertising pop-up popup popups pop-ups">
<body>

<h1>Bust Banner Ads with Proxy Auto Configuration</h1>

<p>
<center>
<table border=0 width="90%">
<tr valign=top>

<td>
<br><p>
<b>Table Of Contents</b>
<br><a href="#whatis">What Is This?</a>
<br><a href="#howtouse">How Do I Use This?</a>
<br><a href="#gethelp">Where Can I Get Help With This?</a>
<br><a href="#howwork">How Does This Work?</a>
<br><a href="#whatbrowsers">What Browsers Does This Work With?</a>
<br><a href="#addingurls">How Do I Add URLs To Block?</a>
<br><a href="#useproxy">Does This Work If I Already Use A Proxy?</a>
<br><a href="#betterproxy">Why Is This Better Than An Ad-removing Proxy?</a>
<br><a href="#betterhosts">Why Is This Better Than A Hosts File?</a>
<br><a href="#isitworking">How Do I Know If It's Working?</a>
<br><a href="#blackhole">Black Hole Proxy Servers</a>
<br><a href="#deact">How Do I Deactive no-ads For Just One Site?</a>
<br><a href="#popups">Does This Stop Popups / Popunders?</a>

<br>
<p>
<br>
<p>

<center>
<i>This is the coolest thing I've seen in a long time.</i>
<br>
- unsolicited comment from a new user.
</center>
</td>

<td>
<center>
<i>Over two million <small>(more or less)</small> banner ads blocked since 1996!</i>
<p>

<table border=10 cellpadding=5>
<tr><td align=center>
    <a href="no-ads.zip">no-ads.zip</a>,
    <!--#fsize virtual="no-ads.zip"--> bytes
    (or 
    <a href="no-ads.tgz">no-ads.tgz</a>,
    <!--#fsize virtual="no-ads.tgz"--> bytes)
    <br>
    Version <!--#include file=".no-ads.rev"-->
    released on
    <!--#config timefmt="%A, %Y-%b-%d %H:%M:%S %Z"-->
    <!--#flastmod virtual="no-ads.zip"-->
</td></tr>
<tr><td align=left>
    <small><small>

    <div align=right><a href="#" class="button"
    onclick="toggle('fullhistory');toggle('history')">
    Toggle full history</a></div>

    <span id=history>
    Recent changes:<pre><!--#include file=".no-ads.history"--></pre>
    </span>
    <span id=fullhistory style="display:none;">
    All changes:<pre><!--#include file=".no-ads.history.all"--></pre>
    </span>

    </small></small>
</a>
</td></tr>
</table>

<script type="text/javascript">
function toggle(id){
    var elem = document.getElementById(id);
    if (elem.style.display=="none"){
	elem.style.display="block";
	//elem.backgroundPosition="top";
    } else {
	elem.style.display="none";
    }
}
</script>

</center>
</td>
</tr>
</table>

</center>


<h3><a name="whatis">What Is This?</a></h3>

This is a simple change to the configuration of your web browser,
setting it such that it avoids making connections to
banner advertisement servers and avoids downloading ad images.
If your browser can't connect to the advertisement server,
it can't show you the ad image.
The trick behind this is that it uses a mechanism
already built into most recent browsers
(IE, Netscape, Mozilla, and Opera)
and available on most platforms (Windows, Mac, UNIX).


<h3><a name="howtouse">How Do I Use This?</a></h3>

Simply download and save <a href="no-ads.zip">no-ads.zip</a>.
Extract the <i>no-ads.pac</i> file from the ZIP archive.
It is a plain text file.  Open it with an editor or text viewer,
and read the instructions it contains.
<br>
(hint: to open the file on Windows, right-click it and select
<i>Open With</i>, and choose <b>wordpad</b> - do not use notepad)


<h3><a name="gethelp">Where Can I Get Help With This?</a></h3>

I've created a
<a href="http://www.network54.com/Hide/Forum/223428">web forum</a>
where people can discuss no-ads.pac and proxy auto configuration.
<p>
The forum host has started using a gator install on your first visit.
You will not see it you are using no-ads.pac. If you aren't,
<b>do not accept the 'Network54 easyaccess' window</b>
(you will still be able to get into the forum just fine).


<h3><a name="howwork">How Does This Work?</a></h3>

Starting with Netscape 2.0 (when JavaScript was introduced),
Navigator gained the ability to evaluate a JavaScript function
for every URL it was about to load.
The purpose of this mechanism is to automatically and dynamically determine
an appropriate HTTP proxy,
where such a proxy might be dependent upon the URL involved.
Netscape has the
<a href="http://home.netscape.com/eng/mozilla/2.0/relnotes/demo/proxy-live.html">documentation on the Proxy Auto Config JavaScript functions</a> available.

<p>
My use of Proxy Auto Configuration is to <i>avoid using a proxy</i>.
URLs of known anoying images are sent off to a
<a href="#blackhole"><b>black-hole proxy server</b></a>
which swallows the request (and prevents the image from being loaded).
URLs of actual content are unaffected, and directly handled by the broswer.

<p>
(For what it's worth, I came up with this concept back in 1996 when I was looking at
<a href="../javascript/">interesting problems that JavaScript
makes possible</a>)


<h3><a name="whatbrowsers">What Browsers Does This Work With?</a></h3>

Please post updates and corrections to
<a href="#gethelp">the web forum</a>.
<ul>
<li><b>Mozilla, Firefox</b><br>
It works perfectly with all versions of Mozilla from 1.0 and up,
and with Firefox 1.0 and up.

<p>
Mozilla older than 1.4 (and Netscape older than 7.)
require a black hole proxy.
Newer versions of those browsers (and Firedox) implement
<i>Proxy auto-config failover</i>,
which allows them to utilize no-ads.pac without a black hole proxy.

<p>
<li><b>Netscape Navigator</b><br>
It works with recent Mozilla-based Netscape browsers (6.x and 7.x)
(I've not tested it, but I have many reports of success).

<p>
It works with all versions of Netscape Navigator from 2.0
(when I started using this trick)
up to and including 4.0x and 4.7x
(but you should not be using those old browsers anymore).

<p>
Recent versions of no-ads.pac use JavaScript regular expression objects.
This will not work on versions of Navigator prior to 4.0
(and may not work on pre-6.x versions of Netscape).
For those old browsers,
use the <a href="#old">last version of no-ads without RegExps</a>.


<p>
<li><b>Internet Explorer</b><br>
Around IE3,
Microsoft added Proxy Auto Config to Internet Explorer
<small>(their documentation on this used to be at
<a href="http://msdn.microsoft.com/library/periodic/period99/faq0599.htm">
http://msdn.microsoft.com/library/periodic/period99/faq0599.htm</a>,
but Microsoft has removed it)</small>.
I have tested with IE versions 4, 5, 5.5, and 6.
I still use IE5.5 SP2, as that has proved to be
most stable and reliable version
(it still crashes on me, but not as much as other versions;
this is why I now use Mozilla).

<p>
With IE5 and later, you can load the PAC file from a <i>file:</i> URL
This form works: <b>file://c:/no-ads.pac</b>.
I have tested this with IE5.01sp2 (on Win98), IE5.5sp2 (Win98 & Win2K)
and IE6 (on Win2K).
With IE4 and earlier, you need to load the PAC file from an <i>http:</i> URL.

<blockquote>
<dl>
<dt><b>IMPORTANT!</b></dt>
<dd>
For all versions of IE, you <b>must</b> correct the security settings.
Under <i>Tools->Internet Options</i>, select the <i>Security</i> tab.
Select <i>Local intranet</i> and then click the <i>Sites</i> box.
Then, <b>remove the check mark</b> next to the
<i>include all sites that bypass the proxy server</i> option.
</dd>
<p>

<dt><b>IMPORTANT!</b></dt>
<dd>
For IE5.5 and later,
you <b>must</b> disable the <i>Auto Proxy Caching</i> mechanism,
as it defeats the ability to to block ad images on servers that also serve
non-ad content.
To prevent this, add the registry key described in MS KB article
<a href="http://support.microsoft.com/support/kb/articles/Q271/3/61.ASP">Q271361</a>.
To make it easy, you can just download and click on this registry file:
<a href="IE-auto-proxy-cache.reg">IE-auto-proxy-cache.reg</a>.
<p>
<i>Details:</i> This sets the <i>EnableAutoProxyResultCache</i> registry key for the current user.
It also (thanks to <a href="http://pctech.invisibill.net/">InvisiBill</a>)
adds a new group and checkbox to the IE's Internet Options
<i>Advanced</i> tab, that allow you to easily change the setting in the future.
<p>For NT, Win2K, WinXP, you must run it once for <b>each</b> user
on your system using no-ads, as this is a per-user setting
(the same key doesn't work under HKLM).
</dd>
</dl>
</blockquote>

<p>
For IE4, you will possible need to
use the <a href="#old">last version of no-ads without RegExps</a>.

<p>
For IE3, you will need to
use the <a href="#old">last plain version of no-ads</a>.
(I've had one report of no-ads.pac working with IE 3.03.
I've not tried it.  I no longer have an IE3 to test against.)


<p>
<li><b>Opera</b> (6.0 and later)<br>
I have tested with with Opera 6.04 (on Windows 2000).  It works.
<br>
(Note: if you block Opera's own ads, it will stop working after 2 weeks)
<br>
Alternately, you can consider using
<a href="http://www.schrode.net/opera/url_filtering/">Opera's URL filtering hook</a>.  (Although, I don't know if that blocks Opera's own ads)

<p>
<li><b>Other Gecko-based browsers</b><br>
This should work in any Gecko-based browser,
such as Konqueror in KDE3.

<p>
<li><b>Other browsers</b><br>
If they have JavaScript and Proxy Auto Configuration support,
then this should work.
If you try a browser not list here, please
<a href="#gethelp">post an update on the web forum</a>.

</ul>


<h3><a name="addingurls">How Do I Add URLs To Block?</a></h3>

Adding URLs to block is easy.  It will be obvious once you look at no-ads.pac.
The industrious can even find
<a href="http://www.junkbusters.com/ht/en/ijb.html">Junkbuster</a>
blockfiles via
<a href="http://www.google.com/search?q=junkbuster+blockfile">a search engine</a>
and directly add those URLs to the blocked list
(if you do, announce your work
<a href="#gethelp">in the web forum</a>).


<h3><a name="useproxy">Does This Work If I Already Use A Proxy?</a></h3>

Yes!  (See the directions inside the no-ads.pac file)

<p>
It will also work if you already need to use a Proxy Auto Config file,
although that's a little tricky to setup at this time.
<a href="http://www.network54.com/Forum/message?forumid=223428&messageid=1101153093">See this thread</a> in the forum.


<h3><a name="betterproxy">Why Is This Better Than An Ad-removing Proxy?</a></h3>

If you use a ad-removing proxy
(such as
<a href="http://www.junkbusters.com/ht/en/ijb.html">Junkbuster</a>
or
<a href="http://proxomitron.org/">Proxomitron</a>
or
<a href="http://phroggy.com/bannerfilter/">BannerFilter</a>+Squid),
then (by definition), all of your content
must go through the proxy filter.
This might slow down the loading of pages,
or cause other problems as the proxy is always running.
The Proxy Auto Config mechanism avoids this by avoiding a
proxy altogether for the content you actually care about.

<p>
Of course, if you want to control or block cookies,
or dynamically alter content,
then you should try
<a href="http://proxomitron.org/">Proxomitron</a>
(or 
<a href="http://www.junkbusters.com/ht/en/ijb.html">Junkbuster</a>)
and skip no-ads.


<h3><a name="betterhosts">Why Is This Better Than A Hosts File?</a></h3>

Some people use an /etc/hosts (or on Windows, hosts.txt)
file to map hostnames of ad image servers to a non-responding address.
The downside to this is that it cannot be used
for a server that serves both ad and non-ad content.
no-ads can block such hosts easily, but it can also just as
easily block some content on those hosts, not all of it,
since no-ads can block based upon the URL, not just the hostname.



<h3><a name="isitworking">How Do I Know If It's Working?</a></h3>

<a href="test/">Try this test page</a>.
If you can see the picture of me, then no-ads isn't working.
If the picture is blocked, then no-ads is working..

<p>
You can also try these test URLs:
<a href="http://www.yahoo.com/banners/image">www.yahoo.com/banners/image</a>
&amp;
<a href="http://www.yahoo.com/ads/image">www.yahoo.com/ads/image</a>
<br>
If your browser displays Yahoo's <i>Sorry the page was not found</i>,
then no-ads isn't working.

<p>
If you are having problems getting no-ads to work,
then
<a href="#gethelp">post a message in the web forum</a>.


<h3><a name="blackhole">Black Hole Proxy Servers</a></h3>

The simplest black-hole proxy is one that doesn't even exist.
If you use an address on your local host,
then the request will fail immediately.
This is how no-ads.pac is configured by default,
so if you don't mind seeing a <i>missing image</i>
icon for each image that has been blocked,
you have nothing to change or configure.
<b>This works with Mozilla 1.4, Netscape 7.1, and all versions of IE</b>.

<p>
For other browsers, you will need an actual black-hole proxy that somehow
denies every request given to it.  It can either return a HTTP 501 error code,
or server up a replacement image for the blocked ad image.
Here are some options:

<ul>
<li>My simple <i>noproxy</i> shell script
that acts as a blackhole proxy.
It is invoked (on UNIX) via inetd (or equivalent).  It can be configured to
return an image,
a redirect to an image,
or an HTTP error code ("501 No Ads Accepted").
Sample images include a clear (blank) image, or a no-ads logo.
<br>
<a href="noproxy.script">noproxy</a>,
<a href="noproxy.clear.gif">noproxy.clear.gif</a>,
<a href="noproxy.noads.gif">noproxy.noads.gif</a>
<br>Stephen Ostermiller made this image for noproxy that makes it
obvious something was blocked,
and scales well: <a href="noproxy.blocked.gif">noproxy.blocked.gif</a>
<li>Sean Burke has a <a href="http://www.speech.cs.cmu.edu/~sburke/pub/black_hole_http_server.pl">black-hole script written in Perl</a> (UNIX; can be made to work on Windows)
<li>Larry Wang has a <a href="http://s91363763.onlinehome.us/BlackHoleProxy/">black-hole program for Windows</a> (and he also offers the source code)
</ul>



<h3><a name="deact">How Do I Deactive no-ads For Just One Site?</a></h3>

There isn't a provision to deactive no-ads for just one site.
However, you can deactivate no-ads for your current browser process.
(This was contributed by Sean Burke)

<p>
Mozilla always uses one process for all windows/tabs.
IE uses one process per invocation: if you use <i>open in a new window</i>,
the new window is controlled by the same process; but if you click on IE
on the desktop, you get a new process.
Use these special links to deactivate or re-activate no-ads for the current browser process.
<blockquote>
<a href="http://no-ads.int/off">no-ads off</a>
<br>
<a href="http://no-ads.int/on">no-ads on</a>
</blockquote>
<p>
Hint: drag these links to your browser's Link or Personal toolbar.


<h3><a name="old">Old Versions of no-ads.pac</h3>

Sorry, I will not be updating these versions:

<blockquote><table>
<tr><td valign=top>
<li><a href="no-ads-4.zip">no-ads-4.zip</a>
<td>
The last revision (4.28) of no-ads.pac that did not use JavaScript regular expressions.
<br>
Required for Netscape 2.x, 3.x, and possibly 4.x.
Possibly needed for IE4.x.

<tr><td valign=top>
<li><a href="no-ads-3.zip">no-ads-3.zip</a>
<td>
The revision (3.27) of no-ads.pac avoiding JavaScript
<i>alert</i> and <i>var</i> statements.
<br>Required for IE3.
</table>
</blockquote>



<h3><a name="popups">Does This Stop Popups / Popunders?</a></h3>

No-ads is not a popup stopper.  But, it does stop some popups
(as it prevents the loading of JavaScript source that makes the popup happen).
And on other popups, it doesn't stop the popup window from appearing,
but it stops your browser from loading the content.

<P>Personally, I use Mozilla and I enable the
<i>Block Unrequested Popup Windows</i> option.
I <b>never</b> see any popup advertisements.

<!-- pop this
http://www.mathies.com/popthis/
-->


<hr size=4>
<div align=center>
<small>
This page accessed <!--#exec cgi="/cgi-bin/user/loverso/counter"--> times. 
<br>Last modified on <!--#echo var="LAST_MODIFIED"-->.
<SCRIPT LANGUAGE="JavaScript1.1">
<!--
document.write("<br>(or about " + document.lastModified + ", according to JavaScript)");
//-->
</SCRIPT>
<br>Send comments to
<a href="mailto:john@loverso.southborough.ma.us">John@LoVerso.Southborough.MA.US</a>.
<br>Back to <a href="..">my home page</a>
</small>
</div>

</body>
