Bug 1285314 - Fix extension id overridden with undefined when missing from the manifest. r?aswan
MozReview-Commit-ID: J4Iwl4tYlJX
--- a/toolkit/components/extensions/Extension.jsm
+++ b/toolkit/components/extensions/Extension.jsm
@@ -886,17 +886,20 @@ ExtensionData.prototype = {
let normalized = Schemas.normalize(this.manifest, "manifest.WebExtensionManifest", context);
if (normalized.error) {
this.manifestError(normalized.error);
} else {
this.manifest = normalized.value;
}
try {
- this.id = this.manifest.applications.gecko.id;
+ // Do not override the add-on id that has been already assigned.
+ if (!this.id && this.manifest.applications.gecko.id) {
+ this.id = this.manifest.applications.gecko.id;
+ }
} catch (e) {
// Errors are handled by the type checks above.
}
return this.manifest;
});
},