Bug 626148 - Opening link in new tab from background window opens tab in foreground window; r,a=dolske

This commit is contained in:
Dão Gottwald 2011-01-28 14:58:42 -05:00
Родитель 6f27d900b8
Коммит 48a749a15d
1 изменённых файлов: 7 добавлений и 0 удалений

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

@ -51,6 +51,13 @@ function getBrowserURL()
}
function getTopWin(skipPopups) {
// If this is called in a browser window, use that window regardless of
// whether it's the frontmost window, since commands can be executed in
// background windows (bug 626148).
if (top.document.documentElement.getAttribute("windowtype") == "navigator:browser" &&
(!skipPopups || !top.document.documentElement.getAttribute("chromehidden")))
return top;
if (skipPopups) {
return Components.classes["@mozilla.org/browser/browserglue;1"]
.getService(Components.interfaces.nsIBrowserGlue)