From 0092addd08cfe75c63c4adfd957c896b01a5130a Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 8 Jan 2014 15:19:04 +0000 Subject: [PATCH] ignore SecurityError exception if opener is different security context / cross-origin --- phpgwapi/js/jsapi/egw.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/phpgwapi/js/jsapi/egw.js b/phpgwapi/js/jsapi/egw.js index 47c1bb5543..424583c4c2 100644 --- a/phpgwapi/js/jsapi/egw.js +++ b/phpgwapi/js/jsapi/egw.js @@ -86,11 +86,20 @@ // check for a framework object if (typeof window.framework == 'undefined') { - // try finding it in top or opener's top - if (window.opener && typeof window.opener.top.framework != 'undefined') + try { + // try finding it in top or opener's top + if (window.opener && typeof window.opener.top.framework != 'undefined') + { + window.framework = window.opener.top.framework; + if (debug) console.log('found framework object in opener top'); + } + } + catch(e) { + // ignore SecurityError exception if opener is different security context / cross-origin + } + if (typeof window.framework != 'undefined') { - window.framework = window.opener.top.framework; - if (debug) console.log('found framework object in opener top'); + // set in above try block } else if (window.top && typeof window.top.framework != 'undefined') {