Created
November 3, 2019 22:42
-
-
Save phluid61/0104c54c731c3a2281276febdb5acd5c to your computer and use it in GitHub Desktop.
Greasemonkey script to disable keyboard hijacking
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 hijacking | |
// @description Stop websites from highjacking keyboard shortcuts | |
// | |
// @run-at document-start | |
// @include * | |
// @exclude https://www.youtube.com/* | |
// @grant none | |
// ==/UserScript== | |
(window.opera ? document.body : document).addEventListener('keydown', function(e) { | |
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