How can i detect if a browser tab is focused. I check this Detect If Browser Tab Has Focus
but it's only for IE. what for Google chrome and Firefox. Is there a generic solution for this.
How can i detect if a browser tab is focused. I check this Detect If Browser Tab Has Focus
but it's only for IE. what for Google chrome and Firefox. Is there a generic solution for this.
document.addEventListener('visibilitychange', function(){
document.title = document.hidden; // change tab text for demo
})
use this for Google chrome and Firefox.