mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-03-06 12:00:44 +08:00
feat: add browser push notifications
This commit is contained in:
9
open-isle-cli/public/notifications-sw.js
Normal file
9
open-isle-cli/public/notifications-sw.js
Normal file
@@ -0,0 +1,9 @@
|
||||
self.addEventListener('push', function(event) {
|
||||
const data = event.data ? event.data.text() : 'New notification';
|
||||
event.waitUntil(
|
||||
self.registration.showNotification('OpenIsle', {
|
||||
body: data,
|
||||
icon: '/favicon.ico'
|
||||
})
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user