mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 13:55:43 +00:00
Bug 1170836 - Importing certified themes in dev mode doesn't work r=ferjm a=ryanvm
This commit is contained in:
parent
bdb426b07d
commit
0c44af0c9e
@ -389,6 +389,11 @@ this.ImportExport = {
|
||||
meta.installerIsBrowser = false;
|
||||
meta.role = manifest.role;
|
||||
|
||||
let devMode = false;
|
||||
try {
|
||||
devMode = Services.prefs.getBoolPref("dom.apps.developer_mode");
|
||||
} catch(e) {}
|
||||
|
||||
// Set the appropriate metadata for hosted and packaged apps.
|
||||
if (isPackage) {
|
||||
meta.origin = "app://" + meta.id;
|
||||
@ -398,12 +403,10 @@ this.ImportExport = {
|
||||
yield DOMApplicationRegistry._openPackage(appFile, meta, false);
|
||||
let maxStatus = isSigned ? Ci.nsIPrincipal.APP_STATUS_PRIVILEGED
|
||||
: Ci.nsIPrincipal.APP_STATUS_INSTALLED;
|
||||
try {
|
||||
// Anything is possible in developer mode.
|
||||
if (Services.prefs.getBoolPref("dom.apps.developer_mode")) {
|
||||
maxStatus = Ci.nsIPrincipal.APP_STATUS_CERTIFIED;
|
||||
}
|
||||
} catch(e) {};
|
||||
// Anything is possible in developer mode.
|
||||
if (devMode) {
|
||||
maxStatus = Ci.nsIPrincipal.APP_STATUS_CERTIFIED;
|
||||
}
|
||||
meta.appStatus = AppsUtils.getAppManifestStatus(manifest);
|
||||
debug("Signed app? " + isSigned);
|
||||
if (meta.appStatus > maxStatus) {
|
||||
@ -412,12 +415,12 @@ this.ImportExport = {
|
||||
|
||||
// Custom origin.
|
||||
// We unfortunately can't reuse _checkOrigin here.
|
||||
if (isSigned &&
|
||||
meta.appStatus == Ci.nsIPrincipal.APP_STATUS_PRIVILEGED &&
|
||||
if ((isSigned || devMode) &&
|
||||
meta.appStatus >= Ci.nsIPrincipal.APP_STATUS_PRIVILEGED &&
|
||||
manifest.origin) {
|
||||
let uri;
|
||||
try {
|
||||
uri = Services.io.newURI(aManifest.origin, null, null);
|
||||
uri = Services.io.newURI(manifest.origin, null, null);
|
||||
} catch(e) {
|
||||
throw "InvalidOrigin";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user