From 3315449114d9a7ee3bb2c0534665da3f4642cd60 Mon Sep 17 00:00:00 2001 From: Caleb James DeLisle Date: Wed, 16 Aug 2017 14:30:17 +0200 Subject: [PATCH] Lets try this... --- www/pad/wysiwygarea-plugin.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/www/pad/wysiwygarea-plugin.js b/www/pad/wysiwygarea-plugin.js index 1c87dee2c..d63bc4f10 100644 --- a/www/pad/wysiwygarea-plugin.js +++ b/www/pad/wysiwygarea-plugin.js @@ -471,9 +471,16 @@ // CryptPad var _iframe = window._iframe = iframe.$; var fw = this; - _iframe.contentWindow.onload = function () { + _iframe.contentWindow.onload = function () {} + var intr = setInterval(function () { + //console.log(_iframe.contentWindow.document.body); + if (!_iframe.contentWindow) { return; } + if (!_iframe.contentWindow.document) { return; } + if (_iframe.contentWindow.document.readyState !== 'complete') { return; } + if (!_iframe.contentWindow.document.getElementsByTagName('title').length) { return; } + clearInterval(intr); 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),