Last active
August 29, 2015 14:05
-
-
Save relrod/5857df6cb4892b88c0f8 to your computer and use it in GitHub Desktop.
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
// ==UserScript== | |
// @name Disable Ctrl+s and Ctrl+t interceptions | |
// @description Stop websites from highjacking keyboard shortcuts | |
// | |
// @run-at document-start | |
// @include * | |
// @grant none | |
// ==/UserScript== | |
// This was taken from here: http://superuser.com/a/670040/307969 and modified slightly. | |
keycodes = [9, 83, 84]; | |
(window.opera ? document.body : document).addEventListener('keydown', function(e) { | |
if (keycodes.indexOf(e.keyCode) != -1 && e.ctrlKey) { | |
e.cancelBubble = true; | |
e.stopImmediatePropagation(); | |
} | |
return false; | |
}, !window.opera); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment