Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What about if you open up every article you find potentially interesting in a new tab, and stay on the page?

This is how I use YC news, and I don't think im alone.



I agree. I don't like how the links open over HN, so I always open the outgoing links in new tabs.

Feature request: Could the links to outside sites open in new tabs/windows by default, so that we don't navigate away from HN when we actually use this site?


  // ==UserScript==
  // @name				 news.yc open in new tab
  // @namespace		 http://joshwand.com/
  // @description	 opens links on news.yc's list pages in new tabs/windows
  // @include			 http://news.ycombinator.com/
  // @include			 http://news.ycombinator.com/news
  // @include			 http://news.ycombinator.com/newest
  // @include			 http://news.ycombinator.com/x?*

  // ==/UserScript==

  var a, links, thisdomain;
  thisdomain = window.location.host;

  links = document.getElementsByTagName('a');
  for (var i = 0; i < links.length; i++) {
      a = links[i];
      if (a.host && (a.host != thisdomain || String(a).match(/item\?id=/))) {
          a.target = "_blank";
      }
  }


I would prefer the loop this way:

  for each(a in links) 
   if (a.host && (a.host!=thisdomain || String(a).match(/item\?id=/)))
    a.target = "_blank";


What can I say, I don't actually know JS. I just cargo-culted this from another similar script.


Given the nature of browsers that would be counterproductive: one can easily setup browsers to open new tabs with the middle mouse button, but there's no way to stop new tabs/windows from being opened as such.


Given the way I surf hacker news, I'd get annoyed with that. I only open up new tabs when it takes a long time to load.


You could just use your middle mouse button to click the links; that will open them in a new tab.


That's what I currently do. But I have to actively evaluate the links. Is it a discussion/poll, or will this take me somewhere else?


Yep, I open tons of tabs from the main screen, then I might not even look at it for 15, 30 minutes, then scan it for 10 seconds and kill it. 30 min + 10 sec doesn't indicate interest in my case.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: