Hacker News new | past | comments | ask | show | jobs | submit login
LinksOnHN[n].setAttribute('target',"_blank");
9 points by bosky101 on Dec 21, 2008 | hide | past | favorite | 41 comments
As of dec 21 ,2008 - clicking on stories in HN,open them in the same tab. An average visit to HN involves for me, 10 (right clicks + click ) combo's (on my laptop )

would it help to add a target="_blank" attributes for story links, so that they open in new tabs/windows ( edit: and the tab with HN links remains intact )

this also works out well for those who prefer using the keyboard to navigate links in a page. ( yup, vi/emacs does that to ppl ! )

~B

tags: [accessibility]




Please don't make this change. My #1 pet peeve on the web is a page that opens new browser windows.


maybe it could be a preference. i personally run a greasemonkey script that not only opens links in a new tab, but inserts a topbar so i can vote and get to comments from the article page.


First thing I thought was "greasemonkey" when I read this. But the extra features of your script sound pretty sweet. Is it online somewhere?


Try Hacker News OnePage for Greasemonkey. I love it so far.

http://userscripts.org/scripts/show/30512


I agree. I use the scroll button to open links in new tabs, but sometimes I really want to open a page in the same tab.

This is only seconded by links that are something like: <a href="javascript:void(0);" onclick="someStuff();">

I sure do love opening a tab for javascript:void(0).


just curious, why?

I mean this isnt 5 years ago and sites are opening obtrusive windows that fill up the taskbar and ruin your history


It's just annoying. If I want to open a new window, I'll do that myself by cmd-clicking or some variant of that.


Correct. Best practices are that you do not force your users into any particular browsing habit. Keep it consistent and do not open things in _blank that do not absolutely require it.

There are a million tools for users to control their browsing experience ... in the browser. Do not force it in your application.


> Best practices are that you do not force your users into any particular browsing habit.

Agreed. Is there a plugin in Firefox that ignores target directives and does it the way I want?


Try Tab Mix Plus

https://addons.mozilla.org/en-US/firefox/addon/1122

It has a whole bunch of features, one of which is to force all links to open in the current tab.


"this also works out well for those who prefer using the keyboard to navigate links in a page. ( yup, vi/emacs does that to ppl ! )"

I am a keyboard junkie and I have no problem with Hacker News. I just use the amazing Vimperator extension which adds vim keybindings to Firefox. So to open a link in a new tab I just press "F" to activate quickhints, which displays a number beside each link, then I type the number of the link I want. (Or I can type some text that is contained in the <a> tag). http://vimperator.org

Ultimately this is a browser UI issue, not a Hacker News issue.


While I'm not a Vim user (or even an emacs user) that sounds useful without the knowledge of Vim keyboard shortcuts.


Knowledge of vim is not required but helps; the manual is pretty thorough.


hey, thanks for the tip...


This is a problem YOU have, it's not a problem with the website. So fix it for yourself, there are many ways to do so.


Now would be a great time to learn the joy of mouse gestures, configure your middle click button or install a greasemonkey/userscript.


No. I can already do it with my mouse. I have no desire for site specific short cuts.


I agree. Site specific short cuts are worse thasn useless, because you'd have to use different ones for each site.


You complain about having to perform some arcane action to open a new tab, but in most operating systems, if you press left+right mouse buttons at the same time, it is interpreted as a middle-click.

Also, in firefox, ctrl+enter opens a highlighted link in a new tab while keeping the current tab open. ctrl+shift+enter to open and focus the new tab.


For the other three Opera users on HN, it's the same behavior but reversed: shift-click (or shift-enter if you use shift-arrow navigation) opens in a focused new tab; ctrl-shift-click opens the new tab but sends it to the background for later.


15 key presses to open the top story in a new window?

ctrl+shift+press link does the same, but is pretty much as inconvenient than right click -> open in new tab


doh! ctr+enter opens a terminal for a lot of developers :)

i agree middle button works out best, but that said - a lot of laptop users also dont carry a spare mouse, and "trying to click left and right" on the laptop sort of breaks the flow.

other advantages? ... keeps the index of HN links on one tab the whole day,links opens in new tabs.

it's also a question of "can i eliminate the need of a mouse"


I use ctrl+click, works for me and firefox :P


Same here


Middle click FTW!


i'd love it if hn added a simple checkbox like techmeme to open links in a new tab. The middle click is pretty sweet though.


Why not just write a GreaseMonkey script to do this? Simple enough...


1. Ctrl-Click or the equivalent for your browser.

2. http://userscripts.org/scripts/show/36606 There are other Greasemonkey scripts like this.

3. https://addons.mozilla.org/en-US/firefox/addon/379 There are other extensions like this.

4. Write your own ff extension or gm script.

5. Just use backspace or Alt-LeftArrow.


Implementing this option (as an official HN feature) could be done entirely in Javascript (meaning no need to worry about building more shit into the server) and completed in under an hour.

It would be cool if there were an "HN Labs" that suggested feature submissions and allowed users to add them to their accounts as profile extensions.

Setting up HN links with _blank is also a trivial solution to implement on your own though.


If I want to open a link in a new tab, I click it using the middle mouse button. This works on Firefox on Ubuntu. On your browser/OS combination there is probably something similar; if not, I suggest you upgrade the software you're using.


Make it optional per user :)


This is such a niche feature that I think it would bloat the options pane. This is also a perfect job for greasemonkey :)


I dont think its niche, it seems like the core use case is opening the site and reading through a pick of the front page articles, in that case opening in a new window saves either half the clicks, or having to press back all the time (as long as the article isnt interesting enough to click through further)


Try clicking both of your mousekeys on your laptop at the same time (put your finger in the middle). With some drivers, this simulates a middle-key-click (opens in a new tab)


Another way you can hack this yourself - get FluidApp, and make HN a site-specific web app. All off-site links will automatically spawn in new browsers.


All hail the QuickDrag Firefox extension. Just grab the link and throw it; no keyboarding involved, or trying to press down on the scroll wheel.


No.


Well, since middle click has the same behavior even with @target="_blank", I couldn't care less if they enabled it or not.


On Windows you can use control+click and on a Macintosh you can use command+click.


In firefox, middle-click will open a new tab.


As will holding Control while you click.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: