Last active
July 18, 2023 16:15
-
-
Save Rainyan/bdc81d2280936e26ac8690e7ac1292f9 to your computer and use it in GitHub Desktop.
Make the GitHub web interface usable by turning off all its forced keyboard shortcuts that are interfering with browser and OS shortcuts.
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 all GitHub shortcut keys | |
// @description Make the GitHub web interface usable by turning off all its forced keyboard shortcuts that are interfering with browser and OS shortcuts. | |
// @version 0.3.0 | |
// @namespace githubPls | |
// @include https://github.com/* | |
// @updateURL https://gist.githubusercontent.com/Rainyan/bdc81d2280936e26ac8690e7ac1292f9/raw/ | |
// ==/UserScript== | |
const ALLOWED_KEYS = [ | |
'Backspace', // allow removing lines in web editor | |
'Tab', // allow indenting in web editor | |
]; | |
document.addEventListener('keydown', function(e) { | |
if (ALLOWED_KEYS.includes(e.key)) { | |
return; | |
} | |
e.stopPropagation(); | |
}, true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment