Files
2026-10-24 14:03:52 +07:00

19 lines
616 B
JavaScript

MovimWebsocket.attach(function() {
if (Notification.permission !== 'granted') {
NotificationConfig_ajaxHttpRequest();
}
navigator.serviceWorker.getRegistration(SW_URI).then((registration) => {
if (!registration) {
NotificationConfig_ajaxHttpPushGetConfig();
return;
}
registration.pushManager.getSubscription().then((pushSubscription) => {
NotificationConfig_ajaxHttpPushGetConfig(pushSubscription ? pushSubscription.endpoint : null);
}, () => {
NotificationConfig_ajaxHttpPushGetConfig();
});
});
});