mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 07:13:20 +00:00
Bug 266985 - Obey middlemouse.openNewWindow preference r=dao
Differential Revision: https://phabricator.services.mozilla.com/D70267 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
f9abd62b34
commit
e948520730
@ -223,11 +223,15 @@ function whereToOpenLink(e, ignoreButton, ignoreAlt) {
|
||||
var alt = e.altKey && !ignoreAlt;
|
||||
|
||||
// ignoreButton allows "middle-click paste" to use function without always opening in a new window.
|
||||
var middle = !ignoreButton && e.button == 1;
|
||||
var middleUsesTabs = Services.prefs.getBoolPref(
|
||||
let middle = !ignoreButton && e.button == 1;
|
||||
let middleUsesTabs = Services.prefs.getBoolPref(
|
||||
"browser.tabs.opentabfor.middleclick",
|
||||
true
|
||||
);
|
||||
let middleUsesNewWindow = Services.prefs.getBoolPref(
|
||||
"middlemouse.openNewWindow",
|
||||
false
|
||||
);
|
||||
|
||||
// Don't do anything special with right-mouse clicks. They're probably clicks on context menu items.
|
||||
|
||||
@ -240,7 +244,7 @@ function whereToOpenLink(e, ignoreButton, ignoreAlt) {
|
||||
return "save";
|
||||
}
|
||||
|
||||
if (shift || (middle && !middleUsesTabs)) {
|
||||
if (shift || (middle && !middleUsesTabs && middleUsesNewWindow)) {
|
||||
return "window";
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user