1
const newWindow = window.open("www.google.com", "", "popup"); // A popup window should be opened covering the parent window

setTimeout(() => window.focus(), 3000); // How do you focus back parent window after 3 seconds?

I'm implementing a logout modal due to inactivity for about 30-minutes. Is it possible to gain focus on my window if a user is currently working on another window when the idle timeout is up? So the user can be reminded to continue the session or log out.

Richard
  • 556
  • 5
  • 12
  • Does this answer your question? [Open a window behind the current window using Javascript/jQuery](https://stackoverflow.com/questions/11407153/open-a-window-behind-the-current-window-using-javascript-jquery) – evolutionxbox Oct 10 '22 at 22:40

1 Answers1

0

To my knowledge you cant do so. There is no Javascript API to allow you to communicate across different tabs or windows.

Tabs in modern browsers run as separate processes. This is design is so to address scalability and performance concerns.

Dan Friedman
  • 195
  • 6