July 15, 2011, 2:55 a.m.
posted by jared
Follow Links Without Clicking Them
Hover over any link for a short time to open it in a new tab in the background.
This hack was inspired by dontclick.it (http://dontclick.it), a site that demonstrates some user interaction techniques that don't involve clicking. The site is written in Flash, which annoys me, but it gave me the idea of lazy clicking: the ability to open links just by moving the cursor over the link and leaving it there for a short time. I don't claim that it will cure your carpal tunnel syndrome, but it has changed the way I browse the Web.
This user script runs on nonsecure web pages. By default, it will not run on secure web pages, because it has been my experience that most secure sites, such as online banking sites, are very unweblike and don't support opening links in new tabs.
The script gets a list of all the links (which Firefox helpfully maintains for us in the document.links collection) and attaches three event handlers to each link:
When you move your cursor to a link, the script starts a timer that lasts for 1.5 seconds (1500 milliseconds). When the timer runs down, it calls GM_openInTab to open the link in a new tab.
If you move your cursor off a link within 1.5 seconds, the onmouseout event handler cancels the timer, so the link will not open.
If you actually click a link within 1.5 seconds, the onclick event handler cancels the timer and removes all three event handlers. (Note that you can click a link without leaving the page; for example, holding down the Ctrl key while clicking will open the link in a new tab.) This means that if you manually follow a link, the auto-open behavior disappears and the link will not open twice.
Running the Hack
Before running this hack, you'll need to set up Firefox so that it doesn't bring new tabs to the front. Go to Tools Options Advanced. Under Tabbed Browsing, make sure "Select new tabs opened from links" is not checked, as shown in Figure.
Firefox tab options
Now, install the user script (Tools Install This User Script), and go to http://del.icio.us/popular/. Hover over any link for a short time (1.5 seconds to be precise), and the link will open in a new tab in the background, as shown in Figure.
The script is smart enough not to reopen links you've already opened. If you move your cursor away from the link you just opened, then move it back to the link, it will not open a second time.
The script is also smart enough not to auto-open links you've already clicked. If you move to another link and click while holding down the Ctrl key (or the Command key on Mac OS X), Firefox will open the link in a new tab in the background. If you move away from the link and then move back, it will not auto-open no matter how long you hover over it.