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:
cst%andrew.cmu.edu 2006-07-29 05:44:34 +00:00
parent 1b13b78369
commit d95ad70cd4

View File

@ -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;
}