title: notificationclick event service worker
body: <p><br>
  I'm working with service worker to display notification between my users. In my code I include <code>notificationclick</code> event. With this event I'm trying to manage two cases. First case, if in my browser the page of my site is opening, don't open it but focus on it. Second case, if my browser don't show my site, open it and focus on it. But I haven't been succed...
  <br><br></p>
  
  <p>Here is my current code:</p>
  
  <pre><code>self.addEventListener('notificationclick', function (e) {
      console.log('notification was clicked')
      var notification = e.notification;
      var action = e.action;
  
      if (action === 'close') {
          notification.close();
      } else {
          // This looks to see if the current is already open and
          // focuses if it is
          e.waitUntil(
              self.clients.matchAll().then(function(clientList) {
                  console.log(clientList)
                  if (clientList.length &gt; 0) {
                      console.log(clientList[0])
                      return clientList[0].focus();
                  }
                  return self.clients.openWindow('/');
              })
         );
     };
  });
  </code></pre>