Skip to main content
Added relevant tag; Added paragraph breaks for readability; Added bullet point list for readbility
Source Link

I want to detect when the browser goes out of focus. More specifically, here is my case: I

I have my page opened and when I change the tab, it can be detected using visibilitychange. But when I go to another app, ex: VS Code without specifically minimisingminimizing the browser window or changing the tab, it does not work. Here

Here is a representation: A->my current tab where I want the change to be detected. I go to tab B, the change is detected. I come back to A and then without minimising the browser, I go to VS Code the change is not detected. I go back to tab A, then to tab B and then go to VSCode, the change gets detected.

  • A->my current tab where I want the change to be detected.
  • I go to tab B, the change is detected.
  • I come back to A and then without minimising the browser, I go to VS Code the change is not detected.
  • I go back to tab A, then to tab B and then go to VSCode, the change gets detected.

I want to detect when the browser goes out of focus. More specifically, here is my case: I have my page opened and when I change the tab, it can be detected using visibilitychange. But when I go to another app, ex: VS Code without specifically minimising the browser window or changing the tab, it does not work. Here is a representation: A->my current tab where I want the change to be detected. I go to tab B, the change is detected. I come back to A and then without minimising the browser, I go to VS Code the change is not detected. I go back to tab A, then to tab B and then go to VSCode, the change gets detected.

I want to detect when the browser goes out of focus. More specifically, here is my case:

I have my page opened and when I change the tab, it can be detected using visibilitychange. But when I go to another app, ex: VS Code without specifically minimizing the browser window or changing the tab, it does not work.

Here is a representation:

  • A->my current tab where I want the change to be detected.
  • I go to tab B, the change is detected.
  • I come back to A and then without minimising the browser, I go to VS Code the change is not detected.
  • I go back to tab A, then to tab B and then go to VSCode, the change gets detected.
Source Link

Detect browser out of focus

I want to detect when the browser goes out of focus. More specifically, here is my case: I have my page opened and when I change the tab, it can be detected using visibilitychange. But when I go to another app, ex: VS Code without specifically minimising the browser window or changing the tab, it does not work. Here is a representation: A->my current tab where I want the change to be detected. I go to tab B, the change is detected. I come back to A and then without minimising the browser, I go to VS Code the change is not detected. I go back to tab A, then to tab B and then go to VSCode, the change gets detected.