We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6679d73 commit a5ddf59Copy full SHA for a5ddf59
packages/workbox/templates/sw.plugin.js
@@ -1,10 +1,14 @@
1
window.onNuxtReady(() => {
2
if (!('serviceWorker' in navigator)) {
3
- console.warn('serviceWorker is not supported')
+ console.warn('Service workers are not supported.')
4
return
5
}
6
7
navigator.serviceWorker.register('<%= options.swURL %>', {
8
scope: '<%= options.swScope %>'
9
- })
+ }).then(function(registration) {
10
+ window.$sw = registration
11
+ }).catch(function(error) {
12
+ console.error('Service worker registration failed:', error);
13
+ });
14
})
0 commit comments