About the best analogy I can think of of the PAC file is it's kinda like a "heuristic scanner" that some AV programs have, it is meant to pick up viruses/trojans BEFORE the AV scanner's definitions are updated to catch them, by getting down and dirty in the code and checking out what is going on. So yea, thats kinda how the PAC file is (IMO lol) it is there to block MOST ad servers, etc. I still like the HOSTS file a lot because the HOSTS file blocks cookie requests as well, which the PAC doesn't.
But, thats about all I know about this PAC file lol, heres some research I found on it
QUOTE
Latest Version ALWAYS available from http://www.schooner.com/~loverso/no-ads/ I will not be keeping an up to date version of this file here!
FAQ (provided by above mentioned website, I take no ownership over this, I am providing it here, for your information!)
What Is This?
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).
How Do I Use This?
Simply download and extract the no-ads.pac 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.
(hint: to open the file on Windows, right-click it and select Open With, and choose wordpad - do not use notepad)
Where Can I Get Help With This?
I've created a web forum where people can discuss no-ads.pac and proxy auto configuration.
How Does This Work?
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 documentation on the Proxy Auto Config JavaScript functions available.
My use of Proxy Auto Configuration is to avoid using a proxy. URLs of known anoying images are sent off to a black-hole proxy server which swallows the request (and prevents the image from being loaded). URLs of actual content are unaffected, and directly handled by the broswer.
(For what it's worth, I came up with this concept back in 1996 when I was looking at interesting problems that JavaScript makes possible)
What Browsers Does This Work With?
Please post updates and corrections to the web forum.
* Mozilla, Firebird
It works perfectly with all versions of Mozilla from 1.0 and up, and with Phoenix/Firebird (I've tested 0.6).
Mozilla 1.4 (and Netscape 7.1) implements Proxy auto-config failover. This allows Mozilla to utilize no-ads.pac without a black hole proxy.
* Netscape Navigator
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).
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).
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 last version of no-ads without RegExps.
* Internet Explorer
Around IE3, Microsoft added Proxy Auto Config to Internet Explorer (their documentation on this used to be at http://msdn.microsoft.com/library/periodic...d99/faq0599.htm, but Microsoft has removed it). 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).
With IE5 and later, you can load the PAC file from a file: URL This form works: file://c:/no-ads.pac. 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 http: URL.
IMPORTANT!
For all versions of IE, you must correct the security settings. Under Tools->Internet Options, select the Security tab. Select Local intranet and then click the Sites box. Then, remove the check mark next to the include all sites that bypass the proxy server option.
IMPORTANT!
For IE5.5 and later, you must disable the Auto Proxy Caching 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 Q271361. To make it easy, you can just download and click on this registry file: IE-auto-proxy-cache.reg.
Details: This sets the EnableAutoProxyResultCache registry key for the current user. It also (thanks to InvisiBill) adds a new group and checkbox to the IE's Internet Options Advanced tab, that allow you to easily change the setting in the future.
For NT, Win2K, WinXP, you must run it once for each user on your system using no-ads, as this is a per-user setting (the same key doesn't work under HKLM).
For IE4, you will possible need to use the last version of no-ads without RegExps.
For IE3, you will need to use the last plain version of no-ads. (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.)
* Opera (6.0 and later)
I have tested with with Opera 6.04 (on Windows 2000). It works.
(Note: if you block Opera's own ads, it will stop working after 2 weeks)
Alternately, you can consider using Opera's URL filtering hook. (Although, I don't know if that blocks Opera's own ads)
* Other browsers
If they have JavaScript and Proxy Auto Configuration support, then this should work. If you try a browser not list here, please post an update on the web forum.
How Do I Add URLs To Block?
Adding URLs to block is easy. It will be obvious once you look at no-ads.pac. The industrious can even find Junkbuster blockfiles via a search engine and directly add those URLs to the blocked list (if you do, announce your work in the web forum).
Does This Work If I Already Use A Proxy?
Yes! (See the directions inside the no-ads.pac file)
Why Is This Better Than An Ad-removing Proxy?
If you use a ad-removing proxy (such as Junkbuster or Proxomitron or BannerFilter+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.
Of course, if you want to control or block cookies, or dynamically alter content, then you should try Proxomitron (or Junkbuster) and skip no-ads.
Why Is This Better Than A Hosts File?
Some people use a HOSTS 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.
How Do I Know If It's Working?
Try this test page (http://www.schooner.com/~loverso/no-ads/ads/). If the page is blank, then no-ads is working. If you see the message, then no-ads isn't working.
You can also try these test URLs: www.yahoo.com/banners/image & www.yahoo.com/ads/image
If your browser displays Yahoo's Sorry the page was not found, then no-ads isn't working.
If you are having problems getting no-ads to work, then post a message in the web forum.
Black Hole Proxy Servers
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 missing image icon for each image that has been blocked, you have nothing to change or configure. This works with Mozilla 1.4, Netscape 7.1, and all versions of IE.
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:
* My simple noproxy 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.
noproxy, noproxy.clear.gif, noproxy.noads.gif
Stephen Ostermiller made this image for noproxy that makes it obvious something was blocked, and scales well: noproxy.blocked.gif
* Sean Burke has a black-hole script written in Perl (UNIX; can be made to work on Windows)
* Larry Wang has a black-hole program for Windows (and he also offers the source code)
How Do I Deactive no-ads For Just One Site?
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)
Mozilla always uses one process for all windows/tabs. IE uses one process per invocation: if you use open in a new window, 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.
no-ads off (http://no-ads.int/off)
no-ads on (http://no-ads.int/on)
Hint: drag these links to your browser's Link or Personal toolbar.
Old Versions of no-ads.pac
Sorry, I will not be updating these versions:
# no-ads-4.zip
The last revision (4.28) of no-ads.pac that did not use JavaScript regular expressions.
Required for Netscape 2.x, 3.x, and possibly 4.x. Possibly needed for IE4.x.
# no-ads-3.zip
The revision (3.27) of no-ads.pac avoiding JavaScript alert and var statements.
Required for IE3.
Does This Stop Popups / Popunders?
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.
Personally, I use Mozilla and I enable the Block Unrequested Popup Windows option. I never see any popup advertisements.
Advantages
I believe there are many advantages to using the pac file in the context of the workplace, especially for Netscape users.
* Works on many platforms (personally tested on SGI Irix, Windows 98, Windows NT)
* Does not use resources like WebWasher or Proxomitron
* Can take advantage of most JavaScript constructs in the pac file (note that this does not require one to have JS turned on)
* Can easily block entire protocols
* Can replicate the hosts file in a much more compact way through keyword and domain name matching and can block IP addresses
* Is very fast
* Is totally *free*
Disadvantages
* The main disadvantage that I see is that it seems to be limited to Netscape. (Opera support should be coming soon).
* It doesn't support localhost proxy programs (yet but I'm working on it)
Explanation and features
In the next part, I will show the pac file that I use and explain it's features.
At the end of this page is an example pac file that I use. For those of you more familiar with programming, this will probably not look so strange.
Here's how it works. When your browser is set up to work with the pac file (more on the implementation later) it passes the URL and the host arguments to this function called FindProxyForURL. The URL, for example, when accessing Steve's site would be http://www.grc.com whereas the host would be www.grc.com. The pac file determines what proxy should be used, if any, to access the site. If it is an ad server, it will be redirected to localhost (127.0.0.1), similar to the hosts file concept.
The pac file below has three basic sections. One is the ad blocking portion and the other is the protocol blocking portion. The last portion is a test to make sure the pac file is working (usually you'll know anyway).
The ad blocking section has two parts: keyword and domain name filtering. The keyword filtering section is a beast of my creation. It arose from the fact that I noticed that many of the entries in the hosts file had words or phrases that were common across many of the ad server URLs. I felt that one of the limitation of the hosts file is that it could only block known ad servers. I wanted to be more predictive in my filtering and not have to update my hosts file every time there was a new ad server.
So I looked through the hosts file and created the keyword filtering list. It also contains direct IP address filtering (as an example) and keywords I have found from my own surfing experience that needed inclusion as well. Note that these keywords can give some false alarms. It should be modified to fit your needs. You delete this section and for that matter modify the file to suit your individual needs.
The domain name filtering takes its cue from the hosts file list. Notice however that it accomplishes it in a much shorter fashion. I set it up to mimic the look of the hosts file.
The second section shows how the pac file can block entire protocols (just as an example). One could easily combine the protocol and ad filtering constructs as needed.
If none of the ad servers are encountered, say for the site www.grc.com, then the "proxy" returned is a direct connection, i.e. it is not blocked.
The last section is a little test that puts a dialog box to the screen for testing that the pac file is working.
Note that there are two primary Java Script functions that are used to do the ad server and protocol filtering: shExpMatch() and dnsDomainIs(). I could have used shExpMatch everywhere but did not for a good reason. shExpMatch() looks for the string you provide anywhere in the URL or host you pass to it. In the hosts file portion, I felt this would lead to over-filtering. So I use dnsDomainIs which only looks at the domain name.
For dnsDomainIs, I use the host parameter because I want it to filter irregardless of what protocol is used (http, ftp, whatever) since these are known ad servers.
For shExpMatch I use the URL parameter because sometimes I use strings that are protocol dependent. Either function can use the URL or host parameter.
FAQ (provided by above mentioned website, I take no ownership over this, I am providing it here, for your information!)
What Is This?
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).
How Do I Use This?
Simply download and extract the no-ads.pac 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.
(hint: to open the file on Windows, right-click it and select Open With, and choose wordpad - do not use notepad)
Where Can I Get Help With This?
I've created a web forum where people can discuss no-ads.pac and proxy auto configuration.
How Does This Work?
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 documentation on the Proxy Auto Config JavaScript functions available.
My use of Proxy Auto Configuration is to avoid using a proxy. URLs of known anoying images are sent off to a black-hole proxy server which swallows the request (and prevents the image from being loaded). URLs of actual content are unaffected, and directly handled by the broswer.
(For what it's worth, I came up with this concept back in 1996 when I was looking at interesting problems that JavaScript makes possible)
What Browsers Does This Work With?
Please post updates and corrections to the web forum.
* Mozilla, Firebird
It works perfectly with all versions of Mozilla from 1.0 and up, and with Phoenix/Firebird (I've tested 0.6).
Mozilla 1.4 (and Netscape 7.1) implements Proxy auto-config failover. This allows Mozilla to utilize no-ads.pac without a black hole proxy.
* Netscape Navigator
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).
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).
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 last version of no-ads without RegExps.
* Internet Explorer
Around IE3, Microsoft added Proxy Auto Config to Internet Explorer (their documentation on this used to be at http://msdn.microsoft.com/library/periodic...d99/faq0599.htm, but Microsoft has removed it). 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).
With IE5 and later, you can load the PAC file from a file: URL This form works: file://c:/no-ads.pac. 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 http: URL.
IMPORTANT!
For all versions of IE, you must correct the security settings. Under Tools->Internet Options, select the Security tab. Select Local intranet and then click the Sites box. Then, remove the check mark next to the include all sites that bypass the proxy server option.
IMPORTANT!
For IE5.5 and later, you must disable the Auto Proxy Caching 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 Q271361. To make it easy, you can just download and click on this registry file: IE-auto-proxy-cache.reg.
Details: This sets the EnableAutoProxyResultCache registry key for the current user. It also (thanks to InvisiBill) adds a new group and checkbox to the IE's Internet Options Advanced tab, that allow you to easily change the setting in the future.
For NT, Win2K, WinXP, you must run it once for each user on your system using no-ads, as this is a per-user setting (the same key doesn't work under HKLM).
For IE4, you will possible need to use the last version of no-ads without RegExps.
For IE3, you will need to use the last plain version of no-ads. (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.)
* Opera (6.0 and later)
I have tested with with Opera 6.04 (on Windows 2000). It works.
(Note: if you block Opera's own ads, it will stop working after 2 weeks)
Alternately, you can consider using Opera's URL filtering hook. (Although, I don't know if that blocks Opera's own ads)
* Other browsers
If they have JavaScript and Proxy Auto Configuration support, then this should work. If you try a browser not list here, please post an update on the web forum.
How Do I Add URLs To Block?
Adding URLs to block is easy. It will be obvious once you look at no-ads.pac. The industrious can even find Junkbuster blockfiles via a search engine and directly add those URLs to the blocked list (if you do, announce your work in the web forum).
Does This Work If I Already Use A Proxy?
Yes! (See the directions inside the no-ads.pac file)
Why Is This Better Than An Ad-removing Proxy?
If you use a ad-removing proxy (such as Junkbuster or Proxomitron or BannerFilter+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.
Of course, if you want to control or block cookies, or dynamically alter content, then you should try Proxomitron (or Junkbuster) and skip no-ads.
Why Is This Better Than A Hosts File?
Some people use a HOSTS 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.
How Do I Know If It's Working?
Try this test page (http://www.schooner.com/~loverso/no-ads/ads/). If the page is blank, then no-ads is working. If you see the message, then no-ads isn't working.
You can also try these test URLs: www.yahoo.com/banners/image & www.yahoo.com/ads/image
If your browser displays Yahoo's Sorry the page was not found, then no-ads isn't working.
If you are having problems getting no-ads to work, then post a message in the web forum.
Black Hole Proxy Servers
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 missing image icon for each image that has been blocked, you have nothing to change or configure. This works with Mozilla 1.4, Netscape 7.1, and all versions of IE.
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:
* My simple noproxy 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.
noproxy, noproxy.clear.gif, noproxy.noads.gif
Stephen Ostermiller made this image for noproxy that makes it obvious something was blocked, and scales well: noproxy.blocked.gif
* Sean Burke has a black-hole script written in Perl (UNIX; can be made to work on Windows)
* Larry Wang has a black-hole program for Windows (and he also offers the source code)
How Do I Deactive no-ads For Just One Site?
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)
Mozilla always uses one process for all windows/tabs. IE uses one process per invocation: if you use open in a new window, 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.
no-ads off (http://no-ads.int/off)
no-ads on (http://no-ads.int/on)
Hint: drag these links to your browser's Link or Personal toolbar.
Old Versions of no-ads.pac
Sorry, I will not be updating these versions:
# no-ads-4.zip
The last revision (4.28) of no-ads.pac that did not use JavaScript regular expressions.
Required for Netscape 2.x, 3.x, and possibly 4.x. Possibly needed for IE4.x.
# no-ads-3.zip
The revision (3.27) of no-ads.pac avoiding JavaScript alert and var statements.
Required for IE3.
Does This Stop Popups / Popunders?
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.
Personally, I use Mozilla and I enable the Block Unrequested Popup Windows option. I never see any popup advertisements.
Advantages
I believe there are many advantages to using the pac file in the context of the workplace, especially for Netscape users.
* Works on many platforms (personally tested on SGI Irix, Windows 98, Windows NT)
* Does not use resources like WebWasher or Proxomitron
* Can take advantage of most JavaScript constructs in the pac file (note that this does not require one to have JS turned on)
* Can easily block entire protocols
* Can replicate the hosts file in a much more compact way through keyword and domain name matching and can block IP addresses
* Is very fast
* Is totally *free*
Disadvantages
* The main disadvantage that I see is that it seems to be limited to Netscape. (Opera support should be coming soon).
* It doesn't support localhost proxy programs (yet but I'm working on it)
Explanation and features
In the next part, I will show the pac file that I use and explain it's features.
At the end of this page is an example pac file that I use. For those of you more familiar with programming, this will probably not look so strange.
Here's how it works. When your browser is set up to work with the pac file (more on the implementation later) it passes the URL and the host arguments to this function called FindProxyForURL. The URL, for example, when accessing Steve's site would be http://www.grc.com whereas the host would be www.grc.com. The pac file determines what proxy should be used, if any, to access the site. If it is an ad server, it will be redirected to localhost (127.0.0.1), similar to the hosts file concept.
The pac file below has three basic sections. One is the ad blocking portion and the other is the protocol blocking portion. The last portion is a test to make sure the pac file is working (usually you'll know anyway).
The ad blocking section has two parts: keyword and domain name filtering. The keyword filtering section is a beast of my creation. It arose from the fact that I noticed that many of the entries in the hosts file had words or phrases that were common across many of the ad server URLs. I felt that one of the limitation of the hosts file is that it could only block known ad servers. I wanted to be more predictive in my filtering and not have to update my hosts file every time there was a new ad server.
So I looked through the hosts file and created the keyword filtering list. It also contains direct IP address filtering (as an example) and keywords I have found from my own surfing experience that needed inclusion as well. Note that these keywords can give some false alarms. It should be modified to fit your needs. You delete this section and for that matter modify the file to suit your individual needs.
The domain name filtering takes its cue from the hosts file list. Notice however that it accomplishes it in a much shorter fashion. I set it up to mimic the look of the hosts file.
The second section shows how the pac file can block entire protocols (just as an example). One could easily combine the protocol and ad filtering constructs as needed.
If none of the ad servers are encountered, say for the site www.grc.com, then the "proxy" returned is a direct connection, i.e. it is not blocked.
The last section is a little test that puts a dialog box to the screen for testing that the pac file is working.
Note that there are two primary Java Script functions that are used to do the ad server and protocol filtering: shExpMatch() and dnsDomainIs(). I could have used shExpMatch everywhere but did not for a good reason. shExpMatch() looks for the string you provide anywhere in the URL or host you pass to it. In the hosts file portion, I felt this would lead to over-filtering. So I use dnsDomainIs which only looks at the domain name.
For dnsDomainIs, I use the host parameter because I want it to filter irregardless of what protocol is used (http, ftp, whatever) since these are known ad servers.
For shExpMatch I use the URL parameter because sometimes I use strings that are protocol dependent. Either function can use the URL or host parameter.
I won't go in too much detail about this, since I'm no "PAC guru" like I am a "HOSTS guru" lol but I thought I'd put it up here, to let you all know there ARE other alternatives, and basically, to show, that most marketed alternatives aren't always the best (this is free, like the HOSTS file).
About the best thing I can see, is that it blocks images/ads served on the same server...such as www.askchopper.com, they have ads on there web site, but they are served FROM the www.askchopper.com host, so, by adding www.askchopper.com to the HOSTS, I wouldnt be able to surf into that site, but this PAC file will just filter subdirectories on sites, used to show ads.
no-ads.zip is included. I havent tested it myself, but it looks legit (all it is it plain text).
Updated PAC file!