Backed out changeset 055b01695448 (bug 1330349)

This commit is contained in:
Sebastian Hengst 2017-03-01 20:07:11 +01:00
parent bf3a895666
commit 01a59dc23c
2 changed files with 11 additions and 27 deletions

View File

@ -951,7 +951,7 @@ Object.defineProperty(this, "isAddonPartOfE10SRollout", {
return true;
}
if (policy.webextensions && (aAddon.type == "webextension" || aAddon.type == "webextension-theme")) {
if (policy.webextensions && aAddon.type == "webextension") {
return true;
}

View File

@ -242,9 +242,8 @@ if (!AppConstants.RELEASE_OR_BETA)
// Some add-on types that we track internally are presented as other types
// externally
const TYPE_ALIASES = {
"apiextension": "extension",
"webextension": "extension",
"webextension-theme": "theme",
"apiextension": "extension",
};
const CHROME_TYPES = new Set([
@ -254,20 +253,18 @@ const CHROME_TYPES = new Set([
]);
const RESTARTLESS_TYPES = new Set([
"apiextension",
"webextension",
"dictionary",
"experiment",
"locale",
"webextension",
"webextension-theme",
"apiextension",
]);
const SIGNED_TYPES = new Set([
"apiextension",
"webextension",
"extension",
"experiment",
"webextension",
"webextension-theme",
"apiextension",
]);
// This is a random number array that can be used as "salt" when generating
@ -403,17 +400,6 @@ function addonMap(addons) {
return new Map(addons.map(a => [a.id, a]));
}
/**
* Helper function that determines whether an addon of a certain type is a
* WebExtension.
*
* @param {String} type
* @return {Boolean}
*/
function isWebExtension(type) {
return type == "webextension" || type == "webextension-theme";
}
/**
* Sets permissions on a file
*
@ -947,7 +933,6 @@ var loadManifestFromWebManifest = Task.async(function*(aUri) {
let extension = new ExtensionData(uri);
let manifest = yield extension.readManifest();
let theme = !!manifest.theme;
// Read the list of available locales, and pre-load messages for
// all locales.
@ -971,7 +956,7 @@ var loadManifestFromWebManifest = Task.async(function*(aUri) {
let addon = new AddonInternal();
addon.id = bss.id;
addon.version = manifest.version;
addon.type = "webextension" + (theme ? "-theme" : "");
addon.type = "webextension";
addon.unpack = false;
addon.strictCompatibility = true;
addon.bootstrap = true;
@ -4455,9 +4440,8 @@ this.XPIProvider = {
*/
isBlockingE10s(aAddon) {
if (aAddon.type != "extension" &&
aAddon.type != "theme" &&
aAddon.type != "webextension" &&
aAddon.type != "webextension-theme")
aAddon.type != "theme")
return false;
// The hotfix is exempt
@ -4744,7 +4728,7 @@ this.XPIProvider = {
let uri = getURIForResourceInFile(aFile, "bootstrap.js").spec;
if (aType == "dictionary")
uri = "resource://gre/modules/addons/SpellCheckDictionaryBootstrap.js"
else if (isWebExtension(aType))
else if (aType == "webextension")
uri = "resource://gre/modules/addons/WebExtensionBootstrap.js"
else if (aType == "apiextension")
uri = "resource://gre/modules/addons/APIExtensionBootstrap.js"
@ -5544,7 +5528,7 @@ class AddonInstall {
`Refusing to upgrade addon ${this.existingAddon.id} to different ID ${this.addon.id}`]);
}
if (isWebExtension(this.existingAddon.type) && !isWebExtension(this.addon.type)) {
if (this.existingAddon.type == "webextension" && this.addon.type != "webextension") {
zipreader.close();
return Promise.reject([AddonManager.ERROR_UNEXPECTED_ADDON_TYPE,
"WebExtensions may not be upated to other extension types"]);
@ -7227,7 +7211,7 @@ AddonWrapper.prototype = {
},
get isWebExtension() {
return isWebExtension(addonFor(this).type);
return addonFor(this).type == "webextension";
},
get temporarilyInstalled() {