Skip to content

Instantly share code, notes, and snippets.

@onozaty
Created August 11, 2013 14:35
Show Gist options
  • Save onozaty/6205160 to your computer and use it in GitHub Desktop.
Save onozaty/6205160 to your computer and use it in GitHub Desktop.
do not work shortcutkey
var keyElement = aWindow.document.createElement("key");
keyElement.setAttribute("key", key);
keyElement.setAttribute("modifiers", modifiers);
keyElement.setAttribute("oncommand", "void(0);");
keyElement.addEventListener("command", function() {
alert('do command');
}, false);
aWindow.document.getElementById("mainKeyset").appendChild(keyElement);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment