Wenn Browsertab aktiv ist, JQuery
document.addEventListener('visibilitychange', function() {
if(document.hidden)
console.log('Page is hidden from user view');
else
console.log('Page is in user view');
});
Bad Bear