Skip to content

Commit

Permalink
Simplified fix for Access denied error in IE9-10 when running in subd…
Browse files Browse the repository at this point in the history
…omain and document.domain changed.
  • Loading branch information
oleq committed Mar 7, 2013
1 parent d02739b commit 74773ae
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions plugins/wysiwygarea/plugin.js
Expand Up @@ -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();';
Expand All @@ -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;
Expand Down Expand Up @@ -59,7 +60,6 @@
frameBorder: 0,
'aria-describedby' : labelId,
title: frameLabel,
src: src,
tabIndex: editor.tabIndex,
allowTransparency: 'true'
});
Expand Down

0 comments on commit 74773ae

Please sign in to comment.