Skip to content

Instantly share code, notes, and snippets.

@phluid61
Created November 3, 2019 22:42
Show Gist options
  • Save phluid61/0104c54c731c3a2281276febdb5acd5c to your computer and use it in GitHub Desktop.
Save phluid61/0104c54c731c3a2281276febdb5acd5c to your computer and use it in GitHub Desktop.
Greasemonkey script to disable keyboard hijacking
// ==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