Skip to content

Commit 74aa134

Browse files
committed
Merge branch 't/13850'
2 parents 8eb2434 + 2b3093b commit 74aa134

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

plugins/wysiwygarea/plugin.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,17 +508,25 @@
508508
detach: function() {
509509
var editor = this.editor,
510510
doc = editor.document,
511-
iframe = editor.window.getFrame(),
511+
iframe,
512512
onResize;
513513

514+
// Trying to access window's frameElement property on Edge throws an exception
515+
// when frame was already removed from DOM. (#13850, #13790)
516+
try {
517+
iframe = editor.window.getFrame();
518+
} catch ( e ) {}
519+
514520
framedWysiwyg.baseProto.detach.call( this );
515521

516522
// Memory leak proof.
517523
this.clearCustomData();
518524
doc.getDocumentElement().clearCustomData();
519525
CKEDITOR.tools.removeFunction( this._.frameLoadedHandler );
520526

521-
if ( iframe ) {
527+
// On IE, iframe is returned even after remove() method is called on it.
528+
// Checking if parent is present fixes this issue. (#13850)
529+
if ( iframe && iframe.getParent() ) {
522530
iframe.clearCustomData();
523531
onResize = iframe.removeCustomData( 'onResize' );
524532
onResize && onResize.removeListener();

0 commit comments

Comments
 (0)