зеркало из https://github.com/mozilla/pjs.git
fix bugs 231442 and 236241, problems opening Options from non-browser windows, r=bryner
This commit is contained in:
Родитель
a06596008a
Коммит
a13c36f7f8
|
@ -106,16 +106,20 @@ function onOK()
|
|||
}
|
||||
|
||||
function Startup()
|
||||
{
|
||||
if (top.opener) {
|
||||
var browser = top.opener.document.getElementById("content");
|
||||
var l = browser.mPanelContainer.childNodes.length;
|
||||
{
|
||||
var useButton = document.getElementById("browserUseCurrent");
|
||||
|
||||
try {
|
||||
var browser = top.opener.document.getElementById("content");
|
||||
|
||||
if (l > 1) {
|
||||
var useButton = document.getElementById("browserUseCurrent");
|
||||
var l = browser.mPanelContainer.childNodes.length;
|
||||
if (l > 1)
|
||||
useButton.label = useButton.getAttribute("label2");
|
||||
}
|
||||
} catch (e) {
|
||||
// prefwindow wasn't opened from a browser window, so no current page
|
||||
useButton.disabled = true;
|
||||
}
|
||||
|
||||
parent.hPrefWindow.registerOKCallbackFunc(onOK);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче