зеркало из https://github.com/mozilla/pjs.git
Fix for 102120, ability to load tabs in background, r=bryner, sr=hewitt
This commit is contained in:
Родитель
b677339aa8
Коммит
91ddf610f3
|
@ -152,9 +152,20 @@
|
|||
switch (event.button) {
|
||||
case 0: // if left button clicked
|
||||
if (event.metaKey || event.ctrlKey) { // and meta or ctrl are down
|
||||
openNewWindowWith(href); // open link in new window
|
||||
event.preventBubble();
|
||||
return true;
|
||||
if (pref && pref.GetBoolPref("browser.tabs.opentabfor.middleclick") && getBrowser &&
|
||||
getBrowser() && getBrowser().localName == "tabbrowser") {
|
||||
var t = getBrowser().addTab(href); // open link in new tab
|
||||
if (!event.shiftKey && !pref.GetBoolPref("browser.tabs.loadInBackground"))
|
||||
getBrowser().selectedTab = t;
|
||||
event.preventBubble();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (pref && pref.GetBoolPref("middlemouse.openNewWindow")) {
|
||||
openNewWindowWith(href); // open link in new window
|
||||
event.preventBubble();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
var saveModifier = true;
|
||||
if (pref) {
|
||||
|
@ -177,11 +188,13 @@
|
|||
if (pref && pref.GetBoolPref("browser.tabs.opentabfor.middleclick") && getBrowser &&
|
||||
getBrowser() && getBrowser().localName == "tabbrowser") {
|
||||
var t = getBrowser().addTab(href); // open link in new tab
|
||||
getBrowser().selectedTab = t;
|
||||
if (!event.shiftKey && !pref.GetBoolPref("browser.tabs.loadInBackground"))
|
||||
getBrowser().selectedTab = t;
|
||||
event.preventBubble();
|
||||
return true;
|
||||
}
|
||||
else if (pref && pref.GetBoolPref("middlemouse.openNewWindow")) {
|
||||
|
||||
if (pref && pref.GetBoolPref("middlemouse.openNewWindow")) {
|
||||
openNewWindowWith(href); // open link in new window
|
||||
event.preventBubble();
|
||||
return true;
|
||||
|
|
|
@ -92,17 +92,19 @@
|
|||
|
||||
function openNewTabWith(url) {
|
||||
|
||||
urlSecurityCheck(url, document);
|
||||
urlSecurityCheck(url, document);
|
||||
var wintype = document.firstChild.getAttribute('windowtype');
|
||||
|
||||
// if and only if the current window is a browser window and it has a document with a character
|
||||
// set, then extract the current charset menu setting from the current document and use it to
|
||||
// initialize the new browser window...
|
||||
if (window && (wintype == "navigator:browser")) {
|
||||
var browser=getBrowser();
|
||||
browser.selectedTab = browser.addTab(url);
|
||||
var browser=getBrowser();
|
||||
var t = browser.addTab(url); // open link in new tab
|
||||
if (pref && !pref.GetBoolPref("browser.tabs.loadInBackground"))
|
||||
browser.selectedTab = t;
|
||||
}
|
||||
|
||||
|
||||
// Fix new window.
|
||||
newWin.saveFileAndPos = true;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче