Skip to content

Commit 7749936

Browse files
committed
Update live-view.js
1 parent ad8c57c commit 7749936

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

live-view/live-view.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,6 +1101,9 @@ async function renderLiveViewMarkdown(file) {
11011101
liveView.innerHTML = '<iframe srcdoc="<!DOCTYPE html><html><head></head><body></body></html>" name="Live view" title="Live view" style="background: hsl(228deg 16% 12%);" class="live-frame" loading="lazy" scrolling="yes" frameborder="0"></iframe>';
11021102

11031103
const liveFrame = liveView.querySelector('.live-frame');
1104+
1105+
await new Promise(resolve => { liveFrame.onload = resolve; });
1106+
11041107
const frameDoc = liveFrame.contentDocument;
11051108

11061109

@@ -1119,9 +1122,7 @@ async function renderLiveViewMarkdown(file) {
11191122

11201123
frameDoc.body.style.display = 'none';
11211124
frameDoc.body.innerHTML = html;
1122-
1123-
frameDoc.head.innerHTML = '<base href="about:blank">';
1124-
1125+
11251126
if (isMobile) frameDoc.body.classList.add('mobile');
11261127
setAttr(frameDoc.body, 'dir', 'auto');
11271128

0 commit comments

Comments
 (0)