Created
August 1, 2017 00:11
-
-
Save azu/06e4ed6077d79b07827646716c902517 to your computer and use it in GitHub Desktop.
This file contains 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
// ==UserScript== | |
// @name Disable keyboard shortcuts | |
// @description Stop websites from highjacking keyboard shortcuts | |
// | |
// @run-at document-start | |
// @include https://github.com/* | |
// @grant none | |
// ==/UserScript== | |
keycodes = [84] // Keycode for 'T', add more keycodes to disable other key captures | |
document.addEventListener('keydown', function(e) { | |
// alert(e.keyCode); //uncomment to find out the keycode for any given key | |
if (keycodes.indexOf(e.keyCode) != -1) | |
{ | |
e.cancelBubble = true; | |
e.stopImmediatePropagation(); | |
} | |
return false; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment