Detect when browser is hidden

As for documentation on modern browser when a page is inactive an hidden/pause event should be raised. I tried :‘hidden’,()=>{
But it seems that these events never get called (“this” is the GameScene) whilst the pre-render and render events are fired. So how can detect when window is hidden or inactive. Thank you


Try with ‘blur’ and ‘focus’

1 Like

I tried both but none is fired while

> document.addEventListener('visibilitychange', () => {
> 			if (document.hidden) {....

is working, what am i doing wrong?

These are emitted from, not (from a scene).