Bug 1365839 - Include build ID on the download and install button. r=mikedeboer draft
authorTimothy Guan-tin Chien <timdream@gmail.com>
Thu, 18 May 2017 13:33:22 +0800
changeset 580069 f2e3f16c0b349681fccf2309a4149c2080470146
parent 580040 baf05f61bc14fdf45511bc1165ce76daa08c5c0f
child 629178 f328de0ca88b363a45006e1c20538aa249b8763a
push id59439
push userbmo:timdream@gmail.com
push dateThu, 18 May 2017 05:34:15 +0000
reviewersmikedeboer
bugs1365839
milestone55.0a1
Bug 1365839 - Include build ID on the download and install button. r=mikedeboer MozReview-Commit-ID: IVGnhuN894z
browser/base/content/aboutDialog-appUpdater.js
--- a/browser/base/content/aboutDialog-appUpdater.js
+++ b/browser/base/content/aboutDialog-appUpdater.js
@@ -170,16 +170,24 @@ appUpdater.prototype =
    */
   selectPanel(aChildID) {
     let panel = document.getElementById(aChildID);
 
     let button = panel.querySelector("button");
     if (button) {
       if (aChildID == "downloadAndInstall") {
         let updateVersion = gAppUpdater.update.displayVersion;
+        // Include the build ID if this is an "a#" (nightly or aurora) build
+        if (/a\d+$/.test(updateVersion)) {
+          let buildID = gAppUpdater.update.buildID;
+          let year = buildID.slice(0, 4);
+          let month = buildID.slice(4, 6);
+          let day = buildID.slice(6, 8);
+          updateVersion += ` (${year}-${month}-${day})`;
+        }
         button.label = this.bundle.formatStringFromName("update.downloadAndInstallButton.label", [updateVersion], 1);
         button.accessKey = this.bundle.GetStringFromName("update.downloadAndInstallButton.accesskey");
       }
       this.updateDeck.selectedPanel = panel;
       if (!document.commandDispatcher.focusedElement || // don't steal the focus
           document.commandDispatcher.focusedElement.localName == "button") // except from the other buttons
         button.focus();