Game in foreground

Sometimes, if I have more than one tab with the game, or when I minimize the windows, some tabs become inactive, so the game is not running as it should.

Is there any way to know when a game is in foreground and when is active? Some event or something is triggered?

Hi @PolVegaTPM,

Yea, you can use the page visibility API for that: