When we change back to the tab containing the phpreport site, we should immediately check the connection with the server, so we don't let users start typing stuff that's going to be lost in case the connection or the session is gone.
Some guidance to implement this: https://howchoo.com/g/mdg5otdhmzk/determine-if-a-tab-has-focus-in-javascript