Skip to content

Commit 4f0f073

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

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

static/js/custom.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ document.onpointerdown = ()=>{
193193
}
194194

195195
function webShare() {
196+
console.log('start init web share feature');
197+
196198
var control = document.importNode(document.querySelector('template').content, true).childNodes[0];
197199
control.addEventListener('pointerdown', oncontroldown);
198200

@@ -216,11 +218,9 @@ function webShare() {
216218
});
217219
}
218220

219-
document.onreadystatechange = function () {
220-
if (document.readyState == "interactive") {
221-
webShare();
222-
}
223-
}
221+
window.addEventListener('DOMContentLoaded', (event) => {
222+
webShare();
223+
});
224224

225225
// remove dashboard iframe on mobile
226226

0 commit comments

Comments
 (0)