forked from joaomgcd/JoinDesktop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsw.js
More file actions
23 lines (19 loc) · 634 Bytes
/
sw.js
File metadata and controls
23 lines (19 loc) · 634 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
let serviceWorker = self;
serviceWorker.addEventListener('install', function (event) {
self.skipWaiting();
const message = '[ServiceWorker] New Version!!';
console.log(message);
let notification ={
body:message
}
serviceWorker.registration.showNotification("Service Worker",notification)
});
serviceWorker.addEventListener('activate',event=>{
self.skipWaiting();
const message = '[ServiceWorker] Activated!!!';
console.log(message);
let notification ={
body:message
}
event.waitUntil(serviceWorker.registration.showNotification("Service Worker",notification))
})