service-bus.js

// -- IS BROWSER TAB ACTIVE
document.addEventListener("visibilitychange", function() {
  // If false - than browser tab is active
  console.log(document.hidden);
});
// --