01.04.08

How to Block New York Times Popups in Camino

Posted in web at 4:00 pm by danvk

I’ve been meaning to write a post for a while about how difficult it is to choose a browser on the Mac. There’s no perfect choice, the Camino browser’s combination of compatibility and a Mac feel has made it mine.

My main gripe about Camino is the lack of plugins, particularly the lack of a good Greasemonkey equivalent. In Firefox, I use Greasemonkey to kill the annoying ads that pop up on nytimes.com whenever you double-click a word. In Camino, I have to avoid double-clicking random words. For some reason, I find this completely impossible.

There’s an official feature request for user script support in Camino, but I’m not holding my breath. The NY Times problem bothered me so much that I spent some time creating a Camino workaround.

The idea is to prevent Camino from loading the JavaScript file that provides this “feature”: http://graphics8.nytimes.com/js/common/screen/altClickToSearch.js

To do so, create a new text file somewhere on your machine (I put mine in ~/Library/nytimes.pac) with the following contents:

function FindProxyForURL(url, host) {
if (url == “http://graphics8.nytimes.com/js/common/screen/altClickToSearch.js”) {
return “PROXY 0.0.0.0:3421″;
}
return “DIRECT”;
}

Save that file and follow these instructions to tell Camino to use your PAC file. In my case, I set network.proxy.autoconfig_url to file:///Users/<your user name>/Library/nytimes.pac. Now clear your cache, restart Camino, and try visiting http://graphics8.nytimes.com/js/common/screen/altClickToSearch.js. If you’ve done it right, you should get an error saying “Proxy Server Refused Connection”.

Enjoy the popup-free browsing!

1 Comment

  1. Leenie said,

    January 15, 2008 at 8:23 pm

    Thank you, Dan!

    I file a request that you should post about possible interpretations of the Second Amendment.