Created
May 23, 2024 09:07
-
-
Save kormat/ca6ee59804de01c0625eba34e08fc3d5 to your computer and use it in GitHub Desktop.
Gerrit/jira keybinding ignore tampermonkey script
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 Gerrit/jira keybinding ignore | |
// @namespace http://tampermonkey.net/ | |
// @version 0.2 | |
// @description Stop gerrit/jira from adding bindings to up-/down-arrow keys. | |
// @author http://github.com/kormat | |
// @match https://gerrit.wikimedia.org/* | |
// @match https://jira.mariadb.org/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var keycodes = [38, 40]; // Up-arrow and Down-arrow | |
document.addEventListener('keydown', function(e) { | |
if (keycodes.indexOf(e.keyCode) != -1) | |
{ | |
e.cancelBubble = true; | |
e.stopImmediatePropagation(); | |
} | |
return false; | |
}, true); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment