Created
January 17, 2013 19:42
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(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