Bug 1294887 - Middle clicking search results does not open a new tab. r=florian

MozReview-Commit-ID: CI3nkVVMLK3

--HG--
extra : rebase_source : eea16bcbde9c798d40966f1486cb2dc3af2abba8
This commit is contained in:
Drew Willcoxon 2016-10-14 23:15:15 -07:00
Родитель 5c7c675383
Коммит 98c23941ca
1 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -1259,6 +1259,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
// 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" ?
@ -1266,10 +1267,10 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
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;