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