@@ -114,6 +114,7 @@ self.addEventListener('notificationclick', (event) => {
|
|||||||
])
|
])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (clients.openWindow) {
|
if (clients.openWindow) {
|
||||||
console.log('open new window', urlToOpen)
|
console.log('open new window', urlToOpen)
|
||||||
|
|
||||||
@@ -121,15 +122,15 @@ self.addEventListener('notificationclick', (event) => {
|
|||||||
if (!client) {
|
if (!client) {
|
||||||
console.log('new window not opened')
|
console.log('new window not opened')
|
||||||
for (const client of clientList) {
|
for (const client of clientList) {
|
||||||
client.postMessage({
|
return client.navigate(urlToOpen)
|
||||||
type: 'notificationClick',
|
// return client.postMessage({
|
||||||
url: urlToOpen,
|
// type: 'notificationClick',
|
||||||
tag: event.notification.tag,
|
// url: urlToOpen,
|
||||||
payload: event.notification.payload,
|
// tag: event.notification.tag,
|
||||||
matchUrl: false,
|
// payload: event.notification.payload,
|
||||||
msg: 'new window not opened',
|
// matchUrl: false,
|
||||||
})
|
// msg: 'new window not opened',
|
||||||
break
|
// })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -137,15 +138,15 @@ self.addEventListener('notificationclick', (event) => {
|
|||||||
console.log('clients.openWindow not available')
|
console.log('clients.openWindow not available')
|
||||||
|
|
||||||
for (const client of clientList) {
|
for (const client of clientList) {
|
||||||
client.postMessage({
|
return client.navigate(urlToOpen)
|
||||||
type: 'notificationClick',
|
// return client.postMessage({
|
||||||
url: urlToOpen,
|
// type: 'notificationClick',
|
||||||
tag: event.notification.tag,
|
// url: urlToOpen,
|
||||||
payload: event.notification.payload,
|
// tag: event.notification.tag,
|
||||||
matchUrl: false,
|
// payload: event.notification.payload,
|
||||||
msg: 'clients.openWindow not available',
|
// matchUrl: false,
|
||||||
})
|
// msg: 'clients.openWindow not available',
|
||||||
break
|
// })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user