Skip to content

Instantly share code, notes, and snippets.

@Sciss
Created April 26, 2019 08:56
Show Gist options
  • Save Sciss/4ec77e0f3a85a4e4d309efcf30669a9b to your computer and use it in GitHub Desktop.
Save Sciss/4ec77e0f3a85a4e4d309efcf30669a9b to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Disable ctrl-F keyboard hijacking
// @description Stop websites from highjacking keyboard shortcuts
//
// @run-at document-start
// @include *
// @grant none
// ==/UserScript==
document.addEventListener('keydown', function(e) {
// alert(e.keyCode); //uncomment to find out the keycode for any given key
if (e.ctrlKey && (e.keyCode == 70))
{
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