Bug 1294887 - Middle clicking search results does not open a new tab. r?florian draft
authorDrew Willcoxon <adw@mozilla.com>
Fri, 14 Oct 2016 23:15:15 -0700
changeset 425618 3e6e4470d62626ed8811d7054239c28e801d099e
parent 406453 3c4c4accb1392bbc70fed3ddebbaa42453963900
child 533961 9c6630bb79c5757a67c1210b1b51c89afec7d3a0
push id32469
push userdwillcoxon@mozilla.com
push dateSat, 15 Oct 2016 06:16:05 +0000
reviewersflorian
bugs1294887
milestone51.0a1
Bug 1294887 - Middle clicking search results does not open a new tab. r?florian MozReview-Commit-ID: CI3nkVVMLK3
browser/base/content/urlbarBindings.xml
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -1227,27 +1227,28 @@ file, You can obtain one at http://mozil
             var search = controller.getValueAt(this.selectedIndex);
 
             // close the autocomplete popup and revert the entered search term
             this.closePopup();
             controller.handleEscape();
 
             // open the search results according to the clicking subtlety
             var where = whereToOpenLink(aEvent, false, true);
+            let params = {};
 
             // But open ctrl/cmd clicks on autocomplete items in a new background tab.
             let modifier = this.AppConstants.platform == "macosx" ?
                            aEvent.metaKey :
                            aEvent.ctrlKey;
             if (where == "tab" && (aEvent instanceof MouseEvent) &&
                 (aEvent.button == 1 || modifier))
-              where = "tab-background";
+              params.inBackground = true;
 
-            searchBar.doSearch(search, where);
-            if (where == "tab-background")
+            searchBar.doSearch(search, where, null, params);
+            if (where == "tab" && params.inBackground)
               searchBar.focus();
             else
               searchBar.value = search;
           }
         ]]></body>
       </method>
     </implementation>
   </binding>