JavaScript Обнаружение вкладки отпуск
window.onblur = function() {
console.log("the user just switched tabs");
};
Friendly Hawk
window.onblur = function() {
console.log("the user just switched tabs");
};