It seems to switch the designMode property to a document object and set it to "On" with this function:
function tryEnableDesignMode(iframe, doc, callback) { try { iframe.contentWindow.document.open(); iframe.contentWindow.document.write(doc); iframe.contentWindow.document.close(); } catch(error) { console.log(error) } if (document.contentEditable) { iframe.contentWindow.document.designMode = "On"; callback(); return true; } else if (document.designMode != null) { try { iframe.contentWindow.document.designMode = "on"; callback(); return true; } catch (error) { console.log(error) } } setTimeout(function(){tryEnableDesignMode(iframe, doc, callback)}, 250); return false; }
source share