WebPush

mail@pastecode.io avatar
unknown
plain_text
2 months ago
314 B
2
Indexable
Never
self.addEventListener('install', (event) => {
  console.log('SW Registered:', { event });

  self.skipWaiting();
});

self.addEventListener('push', function(event) {
  const data = event.data.json();
  
  console.log(data);

  event.waitUntil(self.registration.showNotification(data.notification.title, data));
});
Leave a Comment