Skip to content
Permalink
Browse files

Simplified fix for Access denied error in IE9-10 when running in subd…

…omain and document.domain changed.
  • Loading branch information...
oleq committed Mar 7, 2013
1 parent d02739b commit 74773ae30dc63727fc4a4742549907343fd0cd2e
Showing with 9 additions and 9 deletions.
  1. +9 −9 plugins/wysiwygarea/plugin.js
@@ -12,15 +12,8 @@
CKEDITOR.plugins.add( 'wysiwygarea', {
init: function( editor ) {
editor.addMode( 'wysiwyg', function( callback ) {
var iframe = CKEDITOR.document.createElement( 'iframe' );
iframe.setStyles({ width: '100%', height: '100%' } );
iframe.addClass( 'cke_wysiwyg_frame cke_reset' );

var contentSpace = editor.ui.space( 'contents' );
contentSpace.append( iframe );

var src = 'document.open();' +
// The document domain must be set any time we
// The document domain must be set any time we
// call document.open().
( isCustomDomain ? ( 'document.domain="' + document.domain + '";' ) : '' ) +
'document.close();';
@@ -32,6 +25,14 @@
:
'';

var iframe = CKEDITOR.dom.element.createFromHtml( '<iframe src="' + src + '"></iframe>', CKEDITOR.document );

iframe.setStyles( { width: '100%', height: '100%' } );
iframe.addClass( 'cke_wysiwyg_frame cke_reset' );

var contentSpace = editor.ui.space( 'contents' );
contentSpace.append( iframe );

// Asynchronous iframe loading is only required in IE>8 and Gecko (other reasons probably).
// Do not use it on WebKit as it'll break the browser-back navigation.
var useOnloadEvent = CKEDITOR.env.ie || CKEDITOR.env.gecko;
@@ -59,7 +60,6 @@
frameBorder: 0,
'aria-describedby' : labelId,
title: frameLabel,
src: src,
tabIndex: editor.tabIndex,
allowTransparency: 'true'
});

0 comments on commit 74773ae

Please sign in to comment.
You can’t perform that action at this time.