Try waiting for iframe document.onload instead of looping and waiting for document.body to exist.

This commit is contained in:
Caleb James DeLisle
2017-08-16 12:40:15 +02:00
parent e6cdf955d3
commit 6b174934c8

View File

@@ -471,13 +471,9 @@
// CryptPad
var _iframe = window._iframe = iframe.$;
var fw = this;
var intr = setInterval(function () {
//console.log(_iframe.contentWindow.document.body);
if (_iframe.contentWindow && _iframe.contentWindow.document && _iframe.contentWindow.document.body) {
clearInterval(intr);
_iframe.contentWindow.onload = function () {
CKEDITOR.tools.callFunction(fw._.frameLoadedHandler, _iframe.contentWindow);
}
}, 10);
};
return;
// Work around Firefox bug - error prune when called from XUL (http://dev.ckeditor.com/ticket/320),