Hacker News new | past | comments | ask | show | jobs | submit login

I'm aware of 5 operations that a standard link should support:

- Left-click (obvious)

- Right-click (context menu)

- Middle-click (open in new tab)

- Ctrl-click (open in new tab)

- Shift-click (open in new window)

Most sites support at least one of right/middle/ctrl-click, though sometimes you have to Duplicate the tab and then left-click. If none work, and duplicating the tab loses context, it's probably time to abandon hope and find another website.




Note: if at all possible, don’t implement these yourself! You’ll very probably do it wrong for at least some users. For example, ctrl-click for new tab is platform specific: on macOS it should be cmd-click, and ctrl-click should open a context menu. Most if not all are or can be user-configurable, which might not be detected by JS. But the default behaviors will do the right thing unless you override them.


I'm the parent commenter and I approve this message.


Click-hold-drag is another one I use occasionally. For example to:

* Save the link as a .loc file on the desktop

* Open the link in a tab in another browser window, or another browser altogether.

* Add it to a terminal prompt (e.g. curl/wget)

(try it with some links on this site into the text box or your text editor of choice)


There's a set of events for mobile too, e.g. long-press should pop up menu




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: