зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1555438 - Add support to get appBuildID in RPM. r=johannh
Differential Revision: https://phabricator.services.mozilla.com/D33063 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
71e6682344
Коммит
70eb996035
|
@ -305,6 +305,14 @@ class MessagePort {
|
|||
return new this.window.Promise((resolve, reject) => promise.then(resolve, reject));
|
||||
}
|
||||
|
||||
getAppBuildID() {
|
||||
let principal = this.window.document.nodePrincipal;
|
||||
if (!RPMAccessManager.checkAllowAccess(principal, "getAppBuildID", "yes")) {
|
||||
throw new Error("RPMAccessManager does not allow access to getAppBuildID");
|
||||
}
|
||||
return Services.appinfo.appBuildID;
|
||||
}
|
||||
|
||||
getIntPref(aPref) {
|
||||
let principal = this.window.document.nodePrincipal;
|
||||
if (!RPMAccessManager.checkAllowAccess(principal, "getIntPref", aPref)) {
|
||||
|
|
|
@ -29,6 +29,9 @@ class ChildMessagePort extends MessagePort {
|
|||
defineAs: "RPMRemoveMessageListener",
|
||||
allowCallbacks: true,
|
||||
});
|
||||
Cu.exportFunction(this.getAppBuildID.bind(this), window, {
|
||||
defineAs: "RPMGetAppBuildID",
|
||||
});
|
||||
Cu.exportFunction(this.getIntPref.bind(this), window, {
|
||||
defineAs: "RPMGetIntPref",
|
||||
});
|
||||
|
|
|
@ -25,6 +25,7 @@ module.exports = {
|
|||
sendSyncMessage: false,
|
||||
sendRpcMessage: false,
|
||||
tabEventTarget: false,
|
||||
RPMGetAppBuildID: false,
|
||||
RPMGetIntPref: false,
|
||||
RPMGetBoolPref: false,
|
||||
RPMSetBoolPref: false,
|
||||
|
|
Загрузка…
Ссылка в новой задаче