Thursday, July 17, 2008

Greasemonkey - CNN Ads

Ok, this isn't GM scripting, it's ad host hunting. If you want to block CNN and Fox News ads put this into your hosts file. Those are zeros BTW.

0.0.0.0 ad.doubleclick.net ads.cnn.com

Now this isn't visually pleasing because it blocks all ads and the page will look outa whack but it works.

Warning: this resolves those hosts to your computer so if your running a web server on your computer it's gona see the traffic. Hmm, you could configure your server to always respond with a blank page for requests from those hosts/domains.

Greasemonkey - Fox News Ads

Heh, I decided to get back into some GM scripts starting with the Fox video player. After doing some snooping I realized GM may not be able to do it since it's not a combination flash/JS but completely implemented in flash. So snooping a little traffic I decided to get ad.doubleclick.net out of the way so added a host entry for ad.doubleclick.net to resolve to 0.0.0.0 and low-and-behold the ads are gone. That was easy! :)