forked from extern/egroupware
ignore security exception if window.top is in a different security context
eg. because SiteMgr contact-form is running in an iframe
This commit is contained in:
parent
1c80a22413
commit
d1b963c98b
@ -81,17 +81,19 @@
|
|||||||
catch(e) {
|
catch(e) {
|
||||||
// ignore SecurityError exception if opener is different security context / cross-origin
|
// ignore SecurityError exception if opener is different security context / cross-origin
|
||||||
}
|
}
|
||||||
if (typeof window.egw != 'undefined')
|
try {
|
||||||
{
|
// try finding it in top
|
||||||
// set in above try block
|
if (typeof window.egw == 'undefined' && window.top && typeof window.top.egw != 'undefined')
|
||||||
|
{
|
||||||
|
window.egw = window.top.egw;
|
||||||
|
if (typeof window.top.framework != 'undefined') window.framework = window.top.framework;
|
||||||
|
if (debug) console.log('found egw object in top');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (window.top && typeof window.top.egw != 'undefined')
|
catch(e) {
|
||||||
{
|
// ignore SecurityError exception if top is different security context / cross-origin
|
||||||
window.egw = window.top.egw;
|
|
||||||
if (typeof window.top.framework != 'undefined') window.framework = window.top.framework;
|
|
||||||
if (debug) console.log('found egw object in top');
|
|
||||||
}
|
}
|
||||||
else
|
if (typeof window.egw == 'undefined')
|
||||||
{
|
{
|
||||||
window.egw = {
|
window.egw = {
|
||||||
prefsOnly: true,
|
prefsOnly: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user