fazlurr
3/1/2015 - 3:13 PM

Detect when a tab is focused or not in Chrome with Javascript - http://stackoverflow.com/a/6184276

Detect when a tab is focused or not in Chrome with Javascript - http://stackoverflow.com/a/6184276

window.addEventListener('focus', function() {
    document.title = 'focused';
});

window.addEventListener('blur', function() {
    document.title = 'not focused';
});