Bug 1285314 - Fix extension id overridden with undefined when missing from the manifest. r?aswan draft
authorLuca Greco <lgreco@mozilla.com>
Thu, 07 Jul 2016 20:25:28 +0200
changeset 385180 0885e2d3005d6428f7f1bb06a2a6ec323ddc762c
parent 385040 4a8d8898e507cc918bb1a06cccfd69cb4f3e04b3
child 524860 80dbe8aabf6abd4bf5d5ac4e6b19bb00c42bda57
push id22436
push userluca.greco@alcacoop.it
push dateThu, 07 Jul 2016 18:32:25 +0000
reviewersaswan
bugs1285314
milestone50.0a1
Bug 1285314 - Fix extension id overridden with undefined when missing from the manifest. r?aswan MozReview-Commit-ID: J4Iwl4tYlJX
toolkit/components/extensions/Extension.jsm
--- 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;
     });
   },