logging
This commit is contained in:
@ -1,6 +1,12 @@
|
||||
'use strict'
|
||||
|
||||
console.log('Service Worker Loaded...')
|
||||
|
||||
self.addEventListener('push', function (event) {
|
||||
console.log('Push message', event)
|
||||
if (!(self.Notification && self.Notification.permission === 'granted')) {
|
||||
return
|
||||
}
|
||||
const data = JSON.parse(event.data.text())
|
||||
event.waitUntil(
|
||||
registration.showNotification(data.title, {
|
||||
@ -11,6 +17,7 @@ self.addEventListener('push', function (event) {
|
||||
})
|
||||
|
||||
self.addEventListener('notificationclick', function (event) {
|
||||
console.log('Notification click: tag', event.notification.tag)
|
||||
event.notification.close()
|
||||
event.waitUntil(
|
||||
clients.matchAll({ type: 'window', includeUncontrolled: true }).then(function (clientList) {
|
||||
|
Reference in New Issue
Block a user