Bug 1373570 - Focus the update button in about dialog once there is one visible. draft
authorEvan Tseng <evan@tseng.io>
Wed, 28 Jun 2017 16:03:38 -0700
changeset 611007 0adddcf29c3afbd60eb3ded6ba03e880f6ee03f2
parent 610973 1b065ffd8a535a0ad4c39a912af18e948e6a42c1
child 638040 46b76f72e59d57b82c269e10fe680c07a7329d42
push id69092
push userbmo:evan@tseng.io
push dateWed, 19 Jul 2017 04:06:32 +0000
bugs1373570
milestone56.0a1
Bug 1373570 - Focus the update button in about dialog once there is one visible. MozReview-Commit-ID: JFokKUdDAaY
browser/base/content/aboutDialog.js
--- a/browser/base/content/aboutDialog.js
+++ b/browser/base/content/aboutDialog.js
@@ -61,16 +61,22 @@ function init(aEvent) {
       relNotesLink.href = relNotesURL;
       relNotesLink.hidden = false;
     }
   }
 
   if (AppConstants.MOZ_UPDATER) {
     gAppUpdater = new appUpdater();
 
+    let button = gAppUpdater.updateDeck.selectedPanel.querySelector("button");
+    if (button && (!document.commandDispatcher.focusedElement || // don't steal the focus
+                   document.commandDispatcher.focusedElement.localName == "button")) { // except from the other buttons
+      button.focus();
+    }
+
     let channelLabel = document.getElementById("currentChannel");
     let currentChannelText = document.getElementById("currentChannelText");
     channelLabel.value = UpdateUtils.UpdateChannel;
     if (/^release($|\-)/.test(channelLabel.value))
         currentChannelText.hidden = true;
   }
 
   if (AppConstants.platform == "macosx") {