3 ms·
Is there a simple way in javascript to tell if a tab is currently visible in a browser?
by joejohnson 15y ago
Is there a simple way in javascript to tell if a tab is currently visible in a browser?
- kijin 15y agohttp://stackoverflow.com/questions/1760250/how-to-tell-if-browser-tab-is-active http://stackoverflow.com/questions/1760250/how-to-tell-if-br... But that can still lead to inaccurate measurements of "time on opage" if the user switches back and forth between tabs. Do you only measure the periods during which the tab is active (and if so, how granular?) or do you simply subtract the first active timestamp from the last active timestamp?