blob: 6da713960f1930289ee4cb776088409a703161cc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
function onPush(event) {
console.log('PipelineNotificatinWorker onPush', event);
debugger;
console.log('JSON', event.data.json());
console.log('logo', gon);
console.log('test');
const title = (event.data && event.data.text()) || 'Yay a message';
event.waitUntil(
self.registration.showNotification(title, {
// body: 'We have received a push message',
// icon: gon.gitlab_logo,
body: 'We have received a push message',
icon: '/test/test.png',
tag: 'pipeline-notification-worker',
}),
);
}
self.addEventListener('install', () => {
console.log('PipelineNotificationWorker install');
});
self.addEventListener('push', onPush);
|