Skip to content

Commit ec9827d

Browse files
authored
Merge pull request #122 from codeitcodes/dev
Dev
2 parents f91d685 + 0bbeff1 commit ec9827d

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

live-view/live-view.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ async function renderLiveViewHTML(file) {
877877
}
878878

879879

880-
liveView.innerHTML = '<iframe src="'+ livePath +'" name="' + file.name + '" title="' + file.name + '" 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>';
880+
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>';
881881

882882

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

utils.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,24 @@ window.addEventListener('online', () => { isOffline = false });
187187
window.addEventListener('offline', () => { isOffline = true });
188188

189189

190+
// persistent storage
191+
192+
let isPersistStorage = false;
193+
194+
if (navigator.storage && navigator.storage.persist) {
195+
196+
isPersistStorage = await navigator.storage.persisted();
197+
198+
if (!isPersistStorage) {
199+
200+
// request persistent storage
201+
isPersistStorage = await navigator.storage.persist();
202+
203+
}
204+
205+
}
206+
207+
190208
// base64 encode/decode
191209

192210
let encodeUnicode = (str) => {

0 commit comments

Comments
 (0)