Skip to content

Instantly share code, notes, and snippets.

@kormat
Created May 23, 2024 09:07
Show Gist options
  • Save kormat/ca6ee59804de01c0625eba34e08fc3d5 to your computer and use it in GitHub Desktop.
Save kormat/ca6ee59804de01c0625eba34e08fc3d5 to your computer and use it in GitHub Desktop.
Gerrit/jira keybinding ignore tampermonkey script
// ==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