Detect the browser tab switching/ browser minimising using javascript
<p>I am trying to code my own versions of popular games such as minesweeper, snake etc using JavaScript. Some of the games require timer, so I wonder is it possible to detect whether user switched to another tab or minimized the browser so I can put the game on pause mode? Thanks for any help provided!</p>
