mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 09:49:28 +02:00
Avoid error
This commit is contained in:
parent
814bee95d2
commit
79b440ac43
1 changed files with 13 additions and 7 deletions
|
@ -1689,6 +1689,11 @@ function avideoAjax(url, data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Register service worker to control making site work offline
|
// Register service worker to control making site work offline
|
||||||
|
function serviceWorkerRegister() {
|
||||||
|
if (typeof webSiteRootURL == 'undefined') {
|
||||||
|
setTimeout(function () {serviceWorkerRegister();}, 1000);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if ('serviceWorker' in navigator) {
|
if ('serviceWorker' in navigator) {
|
||||||
navigator.serviceWorker
|
navigator.serviceWorker
|
||||||
.register(webSiteRootURL + 'sw.js')
|
.register(webSiteRootURL + 'sw.js')
|
||||||
|
@ -1696,7 +1701,8 @@ if ('serviceWorker' in navigator) {
|
||||||
console.log('Service Worker Registered');
|
console.log('Service Worker Registered');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
serviceWorkerRegister();
|
||||||
// Code to handle install prompt on desktop
|
// Code to handle install prompt on desktop
|
||||||
|
|
||||||
let deferredPrompt;
|
let deferredPrompt;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue