Index: lib/keySelector.js |
=================================================================== |
--- a/lib/keySelector.js |
+++ b/lib/keySelector.js |
@@ -7,16 +7,29 @@ Cu.import("resource://gre/modules/Servic |
let validModifiers = Object.create(null); |
validModifiers.ACCEL = null; |
validModifiers.CTRL = "control"; |
validModifiers.CONTROL = "control"; |
validModifiers.SHIFT = "shift"; |
validModifiers.ALT = "alt"; |
validModifiers.META = "meta"; |
+let bindingsKeys = null; |
+(function() |
+{ |
+ let request = new XMLHttpRequest(); |
+ request.open("GET", "chrome://global/content/platformHTMLBindings.xml"); |
+ request.addEventListener("load", () => |
+ { |
+ bindingsKeys = request.responseXML.getElementsByTagName("handler"); |
+ }); |
+ request.send(); |
+})(); |
+ |
+ |
/** |
* Sets the correct value of validModifiers.ACCEL. |
*/ |
function initAccelKey() |
{ |
validModifiers.ACCEL = "control"; |
try |
{ |
@@ -60,17 +73,19 @@ KeySelector.prototype = |
*/ |
_initExistingShortcuts: function(/**ChromeWindow*/ window) |
{ |
if (!validModifiers.ACCEL) |
initAccelKey(); |
this._existingShortcuts = Object.create(null); |
- let keys = window.document.getElementsByTagName("key"); |
+ let keys = Array.prototype.slice.apply(window.document.getElementsByTagName("key")); |
+ if (bindingsKeys) |
+ keys.push.apply(keys, bindingsKeys); |
for (let i = 0; i < keys.length; i++) |
{ |
let key = keys[i]; |
let keyData = |
{ |
shift: false, |
meta: false, |
alt: false, |