
Ask HN: Why do links open in the same tab on Hacker News? - esalazar
Why do links open in the same tab on HN? I would love to be able to just click five interesting links and have five new tabs open.
======
brudgers
A user script using Greasemonkey for Firefox or TamperMonkey for
Chrome/Chromium can change the behavior. For example:

    
    
      // ==UserScript==
      // @name        add_target_blank
      // @namespace   com.kludgecode.demonstration
      // @include     https://news.ycombinator.com/news
      // @version     1
      // @grant       none
      // ==/UserScript==
    
      var stories=document.getElementsByClassName("storylink");
      for (story of stories) {
        story.target = "blank";
      };
    

Will add the behavior for the Hacker News front page. I tested with
Greasemonkey and I'd expect it to work for Tampermonkey.

Greasemonkey: [https://addons.mozilla.org/en-
US/firefox/addon/greasemonkey/](https://addons.mozilla.org/en-
US/firefox/addon/greasemonkey/)

Tampermonkey:
[https://chrome.google.com/webstore/detail/tampermonkey/dhdgf...](https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=en)

------
augustt
That's the default on pretty much every site (google, reddit, etc). Instead,
you can cmd/ctrl click the link.

~~~
esalazar
I understand it's the default, but why? Why not add `target="_blank"` or some
javascript to open in a new tab?

~~~
detaro
Because then you can't open it in the same tab. With a normal link the user
can choose how to click, with a forced new tab they can't.

~~~
esalazar
Fair enough.

------
auganov
I just Ctrl-click when I want it in a new tab. Always expect a single click to
open in the current tab, otherwise it's an annoying surprise.

------
_RPM
It's possible that it's a security thing. I consider it a feature.
`window.opener` can do things that might be considered malicious.

------
siquick
I use this Chrome plugin to open links to any external site in a new tab

[https://chrome.google.com/webstore/detail/open-external-
link...](https://chrome.google.com/webstore/detail/open-external-links-in-
ne/pmgjfdndcgbblimbigekghdmgkjbffba)

------
JeffreyKaine
I asked this a while back as well. I'm with you, but the community seems
rather split on the subject.

------
cwt
Use Chrome, install the Vimium plugin: F + {Letter Combo}

------
NetStrikeForce
ctrl (or command) click does the trick, but for me it's easier to just middle-
click with the mouse (or click the wheel).

------
crispytx
Because Hacker News sucks...

~~~
dmlittle
yet you still take the time to browse and comment...

