From c958452d098be0cedf39e96a1ea29b1b5f265067 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Mon, 29 Apr 2013 10:43:13 +0200 Subject: Catch possible "Permission denied" error on iframe elements in IE --- skins/classic/functions.js | 9 +++++++-- skins/larry/ui.js | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/skins/classic/functions.js b/skins/classic/functions.js index 499783b3f..0d2f2231a 100644 --- a/skins/classic/functions.js +++ b/skins/classic/functions.js @@ -664,8 +664,13 @@ function rcmail_scroller(list, top, bottom) function iframe_events() { // this==iframe - var doc = this.contentDocument ? this.contentDocument : this.contentWindow ? this.contentWindow.document : null; - rcube_event.add_listener({ element: doc, object:rcmail_ui, method:'body_mouseup', event:'mouseup' }); + try { + var doc = this.contentDocument ? this.contentDocument : this.contentWindow ? this.contentWindow.document : null; + rcube_event.add_listener({ element: doc, object:rcmail_ui, method:'body_mouseup', event:'mouseup' }); + } + catch (e) { + // catch possible "Permission denied" error in IE + }; }; // Abbreviate mailbox names to fit width of the container diff --git a/skins/larry/ui.js b/skins/larry/ui.js index 1c76f9108..a461b64a0 100644 --- a/skins/larry/ui.js +++ b/skins/larry/ui.js @@ -251,8 +251,13 @@ function rcube_mail_ui() $('iframe').load(function(e){ // this = iframe - var doc = this.contentDocument ? this.contentDocument : this.contentWindow ? this.contentWindow.document : null; - $(doc).mouseup(body_mouseup); + try { + var doc = this.contentDocument ? this.contentDocument : this.contentWindow ? this.contentWindow.document : null; + $(doc).mouseup(body_mouseup); + } + catch (e) { + // catch possible "Permission denied" error in IE + }; }) .contents().mouseup(body_mouseup); -- cgit v1.2.3