Merge pull request #2719 from overleaf/jpa-custom-wsurl-for-beta-users

[frontend] ConnectionManager: add support for ie11

GitOrigin-RevId: ab1280f8da68fa87c266463e617b0a84a48065ce
This commit is contained in:
Jakob Ackermann 2020-04-02 15:48:00 +02:00 committed by Copybot
parent d6fa1b1ca3
commit 1a09965503

View file

@ -101,7 +101,16 @@ define([], function() {
// initial connection attempt
this.updateConnectionManagerState('connecting')
const parsedURL = new URL(this.wsUrl || '/socket.io', window.location)
let parsedURL
try {
parsedURL = new URL(this.wsUrl || '/socket.io', window.location)
} catch (e) {
// hello IE11
parsedURL = {
origin: null,
pathname: '/socket.io'
}
}
this.ide.socket = io.connect(
parsedURL.origin,
{