Hello i have installed a service worker but it works only when i open the page here's the code
self.addEventListener('install', function(event) {
  console.log('service worker online')
});
on install it prits that service worker online but my question is how can i make it work even if the page is not open 
I would like to use it to send browser notifications such as
