Bug 915881 - Allow sideloading of certified apps r=ochameau

This commit is contained in:
Fabrice Desré 2013-09-13 00:49:11 -07:00
Родитель dc772efc10
Коммит 8cefaf40b3
2 изменённых файлов: 2 добавлений и 22 удалений

Просмотреть файл

@ -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.