diff --git a/packages/nitro/src/targets/sw/index.html b/packages/nitro/src/targets/sw/index.html index d34d5ee904..75d0d3b272 100644 --- a/packages/nitro/src/targets/sw/index.html +++ b/packages/nitro/src/targets/sw/index.html @@ -1,6 +1,5 @@ - @@ -9,24 +8,16 @@ if (!('serviceWorker' in navigator)) { throw new Error('Browser not supported!') } - - let timeout - const stopTimer = () => { if (timeout) { clearTimeout(timeout); timeout = undefined } } - const startTimer = () => { stopTimer(); timeout = setTimeout(() => { document.write('Loading...') }, 3000) } - - startTimer() navigator.serviceWorker.register('/nuxt.sw.js').then((registration) => { - stopTimer() console.log('ServiceWorker registration successful with scope:', registration.scope) window.location.reload(false) }).catch(error => { - stopTimer() console.error('ServiceWorker registration failed:', error) document.write(error) }) - - - + + Loading... +