Bug 1404583 - Make openLinkIn not steal focus from the address bar when loading the New Tab page. r=florian
☠☠ backed out by 8b3c3e279588 ☠ ☠
authorDão Gottwald <dao@mozilla.com>
Tue, 10 Oct 2017 13:12:02 +0200
changeset 679085 4e1474612b6402a3cbc70f9e5fcc449d37be018c
parent 679084 fb216e2b987078d7f79d2319072430292be3bc7e
child 679086 415f6ec167208fb652e14621f506065bc1ed3fd2
push id84141
push userbmo:schien@mozilla.com
push dateThu, 12 Oct 2017 11:13:04 +0000
reviewersflorian
bugs1404583
milestone58.0a1
Bug 1404583 - Make openLinkIn not steal focus from the address bar when loading the New Tab page. r=florian MozReview-Commit-ID: BInIyg99m76
browser/base/content/utilityOverlay.js
--- a/browser/base/content/utilityOverlay.js
+++ b/browser/base/content/utilityOverlay.js
@@ -443,16 +443,21 @@ function openLinkIn(url, where, params) 
     targetBrowser.loadURIWithFlags(url, {
       triggeringPrincipal: aTriggeringPrincipal,
       flags,
       referrerURI: aNoReferrer ? null : aReferrerURI,
       referrerPolicy: aReferrerPolicy,
       postData: aPostData,
       userContextId: aUserContextId
     });
+
+    // Don't focus the content area if focus is in the address bar and we're
+    // loading the New Tab page.
+    focusUrlBar = document.activeElement == gURLBar.inputField &&
+                  w.isBlankPageURL(url);
     break;
   case "tabshifted":
     loadInBackground = !loadInBackground;
     // fall through
   case "tab":
     focusUrlBar = !loadInBackground && w.isBlankPageURL(url);
 
     let tabUsedForLoad = w.gBrowser.loadOneTab(url, {