Skip to content

Instantly share code, notes, and snippets.

@cevaris
Created April 7, 2015 19:07
Show Gist options
  • Save cevaris/52d3c2b61b1057b5705a to your computer and use it in GitHub Desktop.
Save cevaris/52d3c2b61b1057b5705a to your computer and use it in GitHub Desktop.
Block Jira Editor Shortcuts
// Here You can type your custom JavaScript...
// Get a list of elements on the page.
var x = document.getElementsByTagName("*");
// Go through each element and check for the accessKey property.
// Obliterate it if found.
for (var i = 0; i < x.length; i++)
{
if(x[i].accessKey)
{
x[i].accessKey = null;
}
if(x[i].getAttributeNode("data-shortcut")) {
x[i].getAttributeNode("data-shortcut").value = null;
}
if(x[i].getAttributeNode("data-operation")) {
x[i].getAttributeNode("data-operation").value = null;
}
}
@cevaris
Copy link
Author

cevaris commented Apr 7, 2015

This javascript can be used in conjunction with Custom JavaScript for websites chrome plugin (or similar Firefox/Safari) to inject javascript for specific hosts.

https://chrome.google.com/webstore/detail/custom-javascript-for-web/poakhlngfciodnhlhhgnaaelnpjljija

Keep in mind, this also disables the CTRL+B and CTRL+F back/forward single character, but at least it does not add more text.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment