Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #18423 from ochameau/kbd
Browse files Browse the repository at this point in the history
Bug 996528 - Revive gaia keyboard in firefox nightly. r=vingtetun
  • Loading branch information
ochameau committed Apr 17, 2014
2 parents 375d87b + 32e8e76 commit 2a38067
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion tools/extensions/browser-helper@gaiamobile.org/bootstrap.js
Expand Up @@ -234,7 +234,28 @@ function startup(data, reason) {
browserWindow.outerWidth - 550);
gDevToolsBrowser.selectToolCommand(browserWindow.gBrowser);

Cu.import('resource://gre/modules/Keyboard.jsm');
let KeyboardGlobal = Cu.import('resource://gre/modules/Keyboard.jsm');

// SystemAppProxy.jsm doesn't ship into Firefox.
// Keyboard.jsm is the only one user of it outside of b2g/ folder.
// So hack it, in order to allow keyboard to send events to the system app
Object.defineProperty(KeyboardGlobal, "SystemAppProxy", {
value: {
dispatchEvent: function (detail) {
let contentWindow = browserWindow.content;
var contentDetail = Components.utils.createObjectIn(contentWindow);
for (var i in detail) {
contentDetail[i] = detail[i];
}
Components.utils.makeObjectPropsNormal(contentDetail);

var customEvt = contentWindow.document.createEvent('CustomEvent');
customEvt.initCustomEvent('mozChromeEvent', true, true, contentDetail);
contentWindow.dispatchEvent(customEvt);
}
}
});

Keyboard.initFormsFrameScript(mm);
mm.loadFrameScript('chrome://global/content/forms.js', true);
}, 'sessionstore-windows-restored', false);
Expand Down

0 comments on commit 2a38067

Please sign in to comment.