It is possible to know if my web application has anyone tab open inside a service worker?
Something like this solve my problem.
self.addEventListener('push', (event) => {
self.clients.matchAll({includeUncontrolled: true, type: 'window'})
.then((clients) => {
if(clients && clients.length > 0) {
// Show notification or do other dependent code
}
});
}, false);