title: Disable notification if my webpage is not open in any tab
body: <p>I want to disable notification if my website tab is closed. How can I achieve this?</p>
  <p>Here is my code to show the firebase push notification.</p>
  <pre><code>const messaging = firebase.messaging();
  
  //Code for show webpage background notification
  messaging.setBackgroundMessageHandler(function(payload) {
     //Code for show notifications
  });
  
  //Code for show webpage foreground notification
  messaging.onMessage(function(payload) {
     //Code for show notifications
  });
  </code></pre>
  <p>I want to show notifications only when the webpage is open. I have to disable notification if the webpage is not opened in any tab.</p>
  <p>Help me how can I achieve this?</p>