Pressing ESC is catched now to avoid FF to close the WS connection.
Added a delay before showing the reconnect dialog, prevents dialog to be displayed before page reload in slow browsers.