Hacker News new | ask | show | jobs
by chii 4643 days ago
i think opening in a new tab for an external link is completely reasonable (i don't care about GA tracking, but if that was one of the reasons, its also a reasonable reason).

Unless your computer is too slow to handle many tabs, having more tabs is almost always better!

1 comments

I agree and don't like to be forced to open external links in the same tab. I've actually written a tampermonkey script to override the default behavior of HN and SO for this reason.

But I hesitate to make this comment as this debate can approach the intensity of the "vim/emacs" debate in its religious fervor.

I don't think 'be forced' means what you think it means.

If a site defaults its links to "same tab" then I can easily override that behaviour and open them in new tabs if I choose (just by using a different mouse button or holding down a key when I click)

If a site defaults links to "new tab", can you tell me the simplest way I can override that behaviour?

I will help you, despite your snarkiness :)

Just use greasemonkey or tampermonkey and a script like this:

    var a = document.getElementsByTagName("a"); 
    for (i=0;i<a.length;i++) { 
        if (a[i].target="_blank") { 
            a[i].target="_self" 
        }                        
    }
It should work for the majority of cases. You should be able to tweak it to handle any exceptions.
Drag the link and drop it into the URL bar of your browser.