Skip to content

Instantly share code, notes, and snippets.

@mislav
Created January 17, 2013 19:42
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mislav/4558999 to your computer and use it in GitHub Desktop.
Save mislav/4558999 to your computer and use it in GitHub Desktop.
Un-fucks hijacked Cmd-clicks on links to open pages in a new tab. Put into your ~/.js
;(function($) {
document.addEventListener('click', function(event) {
if (event.metaKey || event.altKey) {
var link = $(event.target).closest('a[href]')
if (link.size()) event.stopPropagation()
}
}, true)
})(jQuery)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment