Bug 1449860 - Focus the location bar when loading about:home. r?mak draft
authorDão Gottwald <dao@mozilla.com>
Wed, 23 May 2018 11:17:25 +0200
changeset 798681 a40a47ffce70d1bc46eb0a47c1f2434b6d479d1d
parent 798564 9055d9d89a4bca5cf48dda789299559aefca4e54
push id110824
push userdgottwald@mozilla.com
push dateWed, 23 May 2018 09:45:59 +0000
reviewersmak
bugs1449860
milestone62.0a1
Bug 1449860 - Focus the location bar when loading about:home. r?mak MozReview-Commit-ID: FeeNBfGTl7Z
browser/base/content/browser.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -2201,17 +2201,21 @@ function BrowserGoHome(aEvent) {
       gBrowser &&
       gBrowser.selectedTab.pinned)
     where = "tab";
 
   // openTrustedLinkIn in utilityOverlay.js doesn't handle loading multiple pages
   switch (where) {
   case "current":
     loadOneOrMoreURIs(homePage, Services.scriptSecurityManager.getSystemPrincipal());
-    gBrowser.selectedBrowser.focus();
+    if (isBlankPageURL(homePage)) {
+      focusAndSelectUrlBar();
+    } else {
+      gBrowser.selectedBrowser.focus();
+    }
     notifyObservers = true;
     break;
   case "tabshifted":
   case "tab":
     urls = homePage.split("|");
     var loadInBackground = getBoolPref("browser.tabs.loadBookmarksInBackground", false);
     // The homepage observer event should only be triggered when the homepage opens
     // in the foreground. This is mostly to support the homepage changed by extension