We currently register an event listener for the did-fail-load event. It's used for app startup, which works like this:
- we display a window with some simple loader
- we create a hidden main window that tries to load web.comm.app
- If it fails and we get did-fail-load we try to load it again after 1s
- After we are succesful we get did-fisish-load event in which we call show() which displays the hidden window and puts it in front of other windows
The ENG-5606 issue happens when the auto-reload code fails because of network error. For some reason it triggers the did-fail-load event and we do steps (3) and (4). So after we regain network connection we call show() and Comm window steals focus from the user.
This diffs introduces a fix for that - we unregister the did-fail-load event handler after a succesfull web page load as it's only needed for startup.