+ try {
+ // fetch from opening window
+ if (window.opener && window.opener.TYPO3 && window.opener.TYPO3.Icons) {
+ return window.opener.TYPO3.Icons;
+ }
+
+ // fetch from parent
+ if (parent && parent.window.TYPO3 && parent.window.TYPO3.Icons) {
+ return parent.window.TYPO3.Icons;
+ }
+
+ // fetch object from outer frame
+ if (top && top.TYPO3.Icons) {
+ return top.TYPO3.Icons;
+ }
+ } catch (e) {
+ // This only happens if the opener, parent or top is some other url (eg a local file)
+ // which loaded the current window. Then the browser's cross domain policy jumps in
+ // and raises an exception.
+ // For this case we are safe and we can create our global object below.
+ }
+