Bug 1285314 - Fix extension id overridden with undefined when missing from the manifest. r=aswan, a=gchang
authorLuca Greco <lgreco@mozilla.com>
Thu, 07 Jul 2016 20:25:28 +0200
changeset 325646 7a7e5f80e25ee0922485c64b806650c8209edc3d
parent 325645 74d0f7c374dca39a6863ceb5083c2fb36c13f43c
child 325647 4468d257b7959904445ef697aa3ba59889b16fa0
push id9853
push userryanvm@gmail.com
push dateMon, 01 Aug 2016 04:32:09 +0000
treeherdermozilla-aurora@f3790db5cbcb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaswan, gchang
bugs1285314
milestone49.0a2
Bug 1285314 - Fix extension id overridden with undefined when missing from the manifest. r=aswan, a=gchang MozReview-Commit-ID: J4Iwl4tYlJX
toolkit/components/extensions/Extension.jsm
--- a/toolkit/components/extensions/Extension.jsm
+++ b/toolkit/components/extensions/Extension.jsm
@@ -897,17 +897,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;
     });
   },