puerta/internal/server/static/admin-serviceworker.js

12 lines
314 B
JavaScript
Raw Permalink Normal View History

2023-04-16 21:17:36 +00:00
self.addEventListener("activate", event => {
console.log("Service worker activated");
});
self.addEventListener('push', (event) => {
let notification = event.data.text();
console.log(`got notification: ${notification}`)
console.log(`evt: `, event)
self.registration.showNotification(notification);
});