track top EGroupware window in egw object to be used as egw.top instead of window.top, which can throw a security exception

This commit is contained in:
Ralf Becker
2020-05-18 20:55:57 +02:00
parent 5b8e02fded
commit 588cd10043
11 changed files with 30 additions and 29 deletions

View File

@ -149,17 +149,7 @@ function egw_insertJS(_html)
*/
function egw_topWindow()
{
if (typeof window.parent != "undefined" && typeof window.parent.top != "undefined")
{
return window.parent.top;
}
if (typeof window.opener != "undefined" && typeof window.opener.top != "undefined")
{
return window.opener.top;
}
return window.top;
return egw.top;
}
/**
@ -288,14 +278,15 @@ window.egw_getFramework = function()
{
return framework;
}
else if (typeof window.parent.egw_getFramework != "undefined" && window != window.parent)
{
return window.parent.egw_getFramework();
}
else
{
return null;
try {
if (typeof window.parent.egw_getFramework != "undefined" && window != window.parent)
{
return window.parent.egw_getFramework();
}
}
catch (e) {}
return null;
}
/**