Skip to content

Commit a429f93

Browse files
committed
Update live-view.js
1 parent 30690d9 commit a429f93

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

live-view/live-view.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,15 +1001,17 @@ async function renderLiveViewHTML(file) {
10011001
}
10021002

10031003

1004-
liveView.innerHTML = '<iframe src="'+ livePath +'" name="Live view" title="Live view" class="live-frame" allow="accelerometer; camera; encrypted-media; display-capture; geolocation; gyroscope; microphone; midi; clipboard-read; clipboard-write" allowfullscreen="true" allowpaymentrequest="true" loading="lazy" sandbox="allow-downloads allow-forms allow-modals allow-pointer-lock allow-popups allow-presentation allow-same-origin allow-scripts allow-top-navigation-by-user-activation" scrolling="yes" frameborder="0"></iframe>';
1004+
liveView.innerHTML = '<iframe src="'+ livePath +'?'+ workerClientId +'" name="Live view" title="Live view" class="live-frame" allow="accelerometer; camera; encrypted-media; display-capture; geolocation; gyroscope; microphone; midi; clipboard-read; clipboard-write" allowfullscreen="true" allowpaymentrequest="true" loading="lazy" sandbox="allow-downloads allow-forms allow-modals allow-pointer-lock allow-popups allow-presentation allow-same-origin allow-scripts allow-top-navigation-by-user-activation" scrolling="yes" frameborder="0"></iframe>';
10051005

10061006

10071007
const liveFrame = liveView.querySelector('.live-frame');
10081008

1009-
liveFrame.contentWindow.addEventListener('load', () => {
1009+
liveFrame.contentWindow.history.replaceState({}, 'Live view', livePath);
10101010

1011+
liveFrame.contentWindow.addEventListener('load', () => {
1012+
10111013
liveView.classList.add('loaded');
1012-
1014+
10131015
});
10141016

10151017

0 commit comments

Comments
 (0)