зеркало из https://github.com/mozilla/gecko-dev.git
Bug 324443 When contentLoadURL is enabled, middle-clicking a background tab should load the link in that tab rather than the current tab
r+sr=neil
This commit is contained in:
Родитель
aec7d4f9a2
Коммит
b9e7aeb39a
|
@ -316,11 +316,31 @@
|
|||
return openNewTabOrWindow(event, url, false);
|
||||
}
|
||||
|
||||
// If ctrl wasn't down, then just load the url in the current win/tab.
|
||||
if (url != "about:blank") {
|
||||
gURLBar.value = url;
|
||||
// If ctrl wasn't down, then just load the url in the targeted win/tab.
|
||||
var browser = getBrowser();
|
||||
var tab = event.originalTarget;
|
||||
if (tab.localName == "tab" &&
|
||||
tab.parentNode == browser.mTabContainer) {
|
||||
tab.linkedBrowser.userTypedValue = url;
|
||||
if (tab == browser.mCurrentTab && url != "about:blank") {
|
||||
gURLBar.value = url;
|
||||
}
|
||||
tab.linkedBrowser.loadURI(url);
|
||||
if (event.shiftKey != (pref && pref.getBoolPref("browser.tabs.loadInBackground")))
|
||||
browser.selectedTab = tab;
|
||||
}
|
||||
loadURI(url);
|
||||
else if (tab.ownerDocument == document) {
|
||||
tab = browser.addTab(url);
|
||||
if (event.shiftKey != (pref && pref.getBoolPref("browser.tabs.loadInBackground")))
|
||||
browser.selectedTab = tab;
|
||||
}
|
||||
else {
|
||||
if (url != "about:blank") {
|
||||
gURLBar.value = url;
|
||||
}
|
||||
loadURI(url);
|
||||
}
|
||||
|
||||
event.preventBubble();
|
||||
return true;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче