mirror of
https://github.com/classilla/tenfourfox.git
synced 2024-09-10 11:54:40 +00:00
35 lines
985 B
JavaScript
35 lines
985 B
JavaScript
function inputmethod_setup(callback) {
|
|
SimpleTest.waitForExplicitFinish();
|
|
SimpleTest.requestCompleteLog();
|
|
let appInfo = SpecialPowers.Cc['@mozilla.org/xre/app-info;1']
|
|
.getService(SpecialPowers.Ci.nsIXULAppInfo);
|
|
if (appInfo.name != 'B2G') {
|
|
SpecialPowers.Cu.import("resource://gre/modules/Keyboard.jsm", this);
|
|
}
|
|
|
|
let permissions = [];
|
|
['input', 'input-manage', 'browser'].forEach(function(name) {
|
|
permissions.push({
|
|
type: name,
|
|
allow: true,
|
|
context: document
|
|
});
|
|
});
|
|
|
|
SpecialPowers.pushPermissions(permissions, function() {
|
|
let prefs = [
|
|
['dom.mozBrowserFramesEnabled', true],
|
|
// Enable navigator.mozInputMethod.
|
|
['dom.mozInputMethod.enabled', true]
|
|
];
|
|
SpecialPowers.pushPrefEnv({set: prefs}, function() {
|
|
SimpleTest.waitForFocus(callback);
|
|
});
|
|
});
|
|
}
|
|
|
|
function inputmethod_cleanup() {
|
|
SpecialPowers.wrap(navigator.mozInputMethod).setActive(false);
|
|
SimpleTest.finish();
|
|
}
|