Skip to content

Commit 100cb02

Browse files
committed
fix web share not load
1 parent 4f0f073 commit 100cb02

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

static/js/custom.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ document.onpointerdown = ()=>{
194194

195195
function webShare() {
196196
console.log('start init web share feature');
197-
197+
198198
var control = document.importNode(document.querySelector('template').content, true).childNodes[0];
199199
control.addEventListener('pointerdown', oncontroldown);
200200

@@ -218,9 +218,13 @@ function webShare() {
218218
});
219219
}
220220

221-
window.addEventListener('DOMContentLoaded', (event) => {
221+
if( document.readyState !== 'loading' ) {
222222
webShare();
223-
});
223+
} else {
224+
document.addEventListener('DOMContentLoaded', function () {
225+
webShare();
226+
});
227+
}
224228

225229
// remove dashboard iframe on mobile
226230

0 commit comments

Comments
 (0)