mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-29 09:02:03 +00:00
reload sw page after loading
This commit is contained in:
parent
1a6a4cb248
commit
55819d52e0
@ -10,8 +10,10 @@
|
|||||||
window.addEventListener('load', () => {
|
window.addEventListener('load', () => {
|
||||||
navigator.serviceWorker.register('/nuxt.sw.js').then((registration) => {
|
navigator.serviceWorker.register('/nuxt.sw.js').then((registration) => {
|
||||||
console.log('ServiceWorker registration successful with scope:', registration.scope)
|
console.log('ServiceWorker registration successful with scope:', registration.scope)
|
||||||
|
window.location.reload()
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
console.error('ServiceWorker registration failed:', error)
|
console.error('ServiceWorker registration failed:', error)
|
||||||
|
document.write(error)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user