Skip to content

Commit

Permalink
chore: Fix doctype setup for iframe dev pages (#2783)
Browse files Browse the repository at this point in the history
  • Loading branch information
just-boris authored Sep 27, 2024
1 parent 680ece3 commit de33b5d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pages/utils/iframe-wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,14 @@ export function IframeWrapper({ id, AppComponent }: { id: string; AppComponent:
iframeEl.className = styles['full-screen'];
iframeEl.id = id;
iframeEl.title = id;
iframeEl.srcdoc = '<!DOCTYPE html>';
container.appendChild(iframeEl);

const iframeDocument = iframeEl.contentDocument!;
// Prevent iframe document instance from reload
// https://bugzilla.mozilla.org/show_bug.cgi?id=543435
iframeDocument.open();
// set html5 doctype
iframeDocument.writeln('<!DOCTYPE html>');
iframeDocument.close();

const innerAppRoot = iframeDocument.createElement('div');
Expand Down

0 comments on commit de33b5d

Please sign in to comment.