Doctype in the canvas iframe
In the next release, I'll add a new event helper that will allow editing iframe content before load:
Read full answer below ↓Question
Hi. This question has already been asked twice (here and here) but has never got an answer.
Is there a way to add <!DOCTYPE html> as the beginning of the canvas iframe so that the iframe will be in standards mode.
I need this since I am trying to use tinyMce as the custom RTE, and tinyMce requires standards mode.
Answers (4)
In the next release, I'll add a new event helper that will allow editing iframe content before load:
editor.on('frame:load:before', ({ el }) => {
const doc = el.contentDocument;
doc.open();
doc.write("<!DOCTYPE html>");
doc.close();
});
Hello, For future questions or technical issues, which aren't bugs, GitHub's Discussions tab is the place to be. Don't forget to close this issue if it is resolved or write a new detailed message in Discussions -> Q&A category (and close this issue). Thank you for your understanding.
Not really, but I'm open to solutions on how to make it customizable.
Thanks for reporting this, @ashercoren. Great question about [Question]: Doctype in the canvas iframe. The recommended approach with ProseMirror is to use the event-driven API. Start here: Check the GrapesJS documentation for your specific module Look for the on() event listener method Most operati...
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3564
Unable to refresh the iframe
0.17.19 Are you able to reproduce the bug from the demo? YES What is the expected behavior? I had asked a question regarding iframe refresh...
Issue #3142
AssetManager rendering issue
@artf this is the same issue #2760 that has already been addressed before, is this wrong or am i doing? i expected assets not to be shown b...
Issue #3367
Modal template
Is there a way for me to modify the template from a compiled state? https://github.com/artf/grapesjs/blob/d3256e621bb43a537213ffcd86b10dc0b...
Issue #3413
Adding inline scripts and updating old events
In that case, I suggest you access the document of the iframe and to append manually the inline script (to get the document use editor.Canv...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins →Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.
Browse premium plugins →Related tutorials
In-depth guides on the same topic.
Tutorial
How to Build a Production GrapesJS Editor: The Complete Walkthrough of Brief, Preset, Plugins, and Services
A complete walkthrough of building a production GrapesJS editor: how to choose a preset, pick plugins, and scope setup services without burning a sprint.
Tutorial
GrapesJS Inline RTE Plugins Update: CKEditor 5 v0.1.4 and Froala Inline Text Editor
CKEditor 5 Inline for GrapesJS v0.1.4 fixes Studio SDK toolbar clipping, iframe injection and link balloon bugs. Compare with Froala Inline — both $69.
Tutorial
Embed GrapesJS in Your SaaS: A Weekend Guide
Embed GrapesJS in your SaaS and ship a white-label page builder over a weekend. Honest tradeoffs, real code, and the plugins that close the UX gap.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.