We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7ae84a9 commit 07524a2Copy full SHA for 07524a2
packages/workbox/templates/sw.plugin.js
@@ -1,14 +1,11 @@
1
-window.onNuxtReady(() => {
2
- if (!('serviceWorker' in navigator)) {
3
- console.warn('Service workers are not supported.')
4
- return
5
- }
6
-
+if ('serviceWorker' in navigator) {
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
-})
+ console.error('Service worker registration failed:', error)
+ })
+} else {
+ console.warn('Service workers are not supported.')
+}
0 commit comments