Hi,
Here is a slick way to improve upon the idea of adding the advertiser list to your \etc\hosts file:
Set up the \etc\hosts file as described, using the latest list (available from
http://pgl.yoyo.org/adservers/) and pointing to 127.0.0.1.
Download and install Apache HTTP Server from
http://www.apache.org/. (Get the Windows version if you're running Windows, of course.)
Customize the httpd.conf by finding the following #Comments and adding the two ErrorDocument lines after them. This was around line 875 in my httpd.conf file.
#
# Customizable error response (Apache style)
# these come in three flavors
#
# 1) plain text
#ErrorDocument 500 "The server made a boo boo.
# n.b. the single leading (") marks it as text, it does not get output
#
# 2) local redirects
# to redirect to local URL /missing.html
#ErrorDocument 404 /cgi-bin/missing_handler.pl
ErrorDocument 404 /index.html
ErrorDocument 402 /index.html
This instructs Apache to use your index.html file to respond to requests for unknown sites/pages. This is important because ~all~ of the requests it gets will be for for unknown sites/pages.
Next, create an Apache\htdocs\index.html file containing these four lines:
<script>
window.opener=self;
window.close()
</script>
Finally, create a shortcut to Apache.exe in your "C:\Documents and Settings\All Users\Start Menu\Programs\Startup" folder so that it will start automatically.
Now the redirects in your host file point to your own Apache Web Server which not only blocks the ads, but closes the pop-up windows automatically! Ads that are not pop-ups are merely blocked - the window containing them is not closed.
What you've done is set up a "dummy" web server that only knows how to do one thing - close down the browser window that calls it. Of course, ads that originate directly from the site you are browsing will not be blocked. If you are browsing dell.com, you will still see the pop-ups for the latest "Dell Deals" because that comes directly from dell.com, not from an ad server.
One last note - you won't be able to use this "dummy" web server to serve real pages.
One final last note - in addition to the ad servers, you can add other domain names to your \etc\hosts file. If you don't want some piece of software "phoning home" and bugging you about installing their lastest update, just *plonk* their name into your \etc\hosts file and you'll never hear from them again! Sweeeeet!
Rick.C