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

Also, middle-clicking a link opens it in the same tab/window. Is that intentional?


I abhor things like this. Certain types of navigation completely override browser behaviour in this regard and it is somewhat maddening.


It's set up like that in https://github.com/rigoneri/syte/blob/21ed38790bbfab3e7a7321... .

Could be changed to only preventDefault/stopPropagation if it doesn't match one of the specially tagged links, or by setting up a different selector for the specially handled links.


Came here to mention this exact issue. (And related, e.g. cmd+clicking.)

Mislav wrote a great post on how to do this robustly: http://mislav.uniqpath.com/2011/03/click-hijack/

Hope that helps!


That and command-clicking on Mac both need to be controlled for when capturing the click event for links for sure.




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

Search: