зеркало из https://github.com/mozilla/gecko-dev.git
Bug 915881 - Allow sideloading of certified apps r=ochameau
This commit is contained in:
Родитель
dc772efc10
Коммит
8cefaf40b3
|
@ -98,11 +98,6 @@ this.DOMApplicationRegistry = {
|
|||
webapps: { },
|
||||
children: [ ],
|
||||
allAppsLaunchable: false,
|
||||
#ifdef MOZ_OFFICIAL_BRANDING
|
||||
get allowSideloadingCertified() false,
|
||||
#else
|
||||
get allowSideloadingCertified() true,
|
||||
#endif
|
||||
|
||||
init: function() {
|
||||
this.messages = ["Webapps:Install", "Webapps:Uninstall",
|
||||
|
|
|
@ -277,14 +277,7 @@ WebappsActor.prototype = {
|
|||
}
|
||||
}
|
||||
function checkSideloading(aManifest) {
|
||||
let appType = self._getAppType(aManifest.type);
|
||||
|
||||
// In production builds, don't allow installation of certified apps.
|
||||
if (!DOMApplicationRegistry.allowSideloadingCertified &&
|
||||
appType == Ci.nsIPrincipal.APP_STATUS_CERTIFIED) {
|
||||
throw new Error("Installing certified apps is not allowed.");
|
||||
}
|
||||
return appType;
|
||||
return self._getAppType(aManifest.type);
|
||||
}
|
||||
function writeManifest(aAppType) {
|
||||
// Move manifest.webapp to the destination directory.
|
||||
|
@ -330,8 +323,8 @@ WebappsActor.prototype = {
|
|||
run: function run() {
|
||||
try {
|
||||
readManifest().
|
||||
then(checkSideloading).
|
||||
then(writeManifest).
|
||||
then(checkSideloading).
|
||||
then(readMetadata).
|
||||
then(function ({ metadata, appType }) {
|
||||
let origin = metadata.origin;
|
||||
|
@ -390,14 +383,6 @@ WebappsActor.prototype = {
|
|||
}
|
||||
|
||||
let appType = self._getAppType(aManifest.type);
|
||||
|
||||
// In production builds, don't allow installation of certified apps.
|
||||
if (!DOMApplicationRegistry.allowSideloadingCertified &&
|
||||
appType == Ci.nsIPrincipal.APP_STATUS_CERTIFIED) {
|
||||
self._sendError("Installing certified apps is not allowed.", aId);
|
||||
return;
|
||||
}
|
||||
|
||||
let origin = "app://" + aId;
|
||||
|
||||
// Create a fake app object with the minimum set of properties we need.
|
||||
|
|
Загрузка…
Ссылка в новой задаче