Код: Выделить всё
self.addEventListener('notificationclick', (event) => {
event.notification.close();
const link = event.notification.data?.link || self.location.origin
event.waitUntil(
clients.matchAll({ type: 'window', includeUncontrolled: true }).then((clientList) => {
for(const client of clientList)
if(client.url === link && "focus" in client) return client.focus();
try
{
if(clients.openWindow) return clients.openWindow(link);
}
catch (error) {
console.error('catch', err);
}
})
);
});
Я не понимаю, почему и как это нравится?
Подробнее здесь: https://stackoverflow.com/questions/792 ... aboutblank
Мобильная версия