aboutsummaryrefslogtreecommitdiff
path: root/src/services/push
diff options
context:
space:
mode:
Diffstat (limited to 'src/services/push')
-rw-r--r--src/services/push/push.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/services/push/push.js b/src/services/push/push.js
index 4a03a73d..58017ed7 100644
--- a/src/services/push/push.js
+++ b/src/services/push/push.js
@@ -1,3 +1,5 @@
+import runtime from 'serviceworker-webpack-plugin/lib/runtime'
+
function urlBase64ToUint8Array (base64String) {
const padding = '='.repeat((4 - base64String.length % 4) % 4)
const base64 = (base64String + padding)
@@ -13,7 +15,7 @@ function isPushSupported () {
}
function registerServiceWorker () {
- return navigator.serviceWorker.register('/static/sw.js')
+ return runtime.register()
.catch((err) => console.error('Unable to register service worker.', err))
}