modified: index.html

This commit is contained in:
DarkShy
2023-01-14 02:16:58 +03:00
parent 37ea4e795a
commit a690f561a3
2 changed files with 19 additions and 48 deletions

View File

@@ -28,8 +28,14 @@
</div>
</body>
<script>
if (typeof navigator.serviceWorker !== 'undefined') {
navigator.serviceWorker.register('/js/pwabuilder-sw.js')
}
if ('serviceWorker' in navigator) {
window.addEventListener('load', function() {
navigator.serviceWorker.register('https://dakrshy.bronyfurry.com/js/pwabuilder-sw.js').then(function(registration) {
console.log('ServiceWorker registration successful with scope: ', registration.scope);
}, function(err) {
console.log('ServiceWorker registration failed: ', err);
});
});
}
</script>
</html>