I have built a Firefox 22 application in JavaScript/HTML5 and I would like to block the user from opening multiple instances of it (whether it be in a separate tab or a separate browser).
Currently this works to the extent that when you try to open another instance of it, it redirects to about:blank, brings the original instance of the application into focus (switches tab or window), and displays an alert (on the original instance). This is done checking a displayState variable I've set in localStorage.
The problem I've run into is that while the alert is up, the user can open as many instances of the application as he/she wants.
Is there a better way than using (a displayState check in) localStorage to do this? Or is there a way to keep the alert from timing-out the application?