In one of our Lifehacks columns for Make magazine, Merlin forced me to admit that, to fight my tendency to zone out while surfing, I had constructed a haranguing browser, which after five minutes of aimless wandering online would refuse to let me continue without giving some justification for my behaviour. It is shamefully true.
The original hack was a witch's brew of PHP and a Perl http proxy. I've hacked the basic idea into a script for plugin-de-jour GreaseMonkey. Your last unconfined act of browsing, then is to the user script page, where you should be able to install it using Tools->Install User Script. (This is all Firefox-only, natch).
Once installed, you will be pestered every 5 minutes to make a case for your further web browsing. If your work is done, just cancel the dialog box and quit the app; if you’re not finished (and you really need to keep zipping around the Interweb a bit longer), insert a virtual nickel by typing a summary of what you’re working on. This buys you another five minutes. And so on. The script resets the timer after three minutes, so if you spend more than that staring at one page, you'll have beaten the system. I didn't tell you that.
Note that the script can be tweaked with a text editor—change the “5” on line 16 to however many minutes you want to surf unmolested—and, of course, you can just turn off the damned thing if it becomes a nuisance to real work.
The idea, of course, is not to make you insane and interrupt your real work, but to ensure that you’re always aware of the task that brought you where you are—that you not allow a legitimate work search to turn into a 4-hour wikipedia party.
Enjoy it - it's very bare-bones, so let me know if you make any cool elaborations on the idea.