Просмотр исходного кода

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

[frontend] ConnectionManager: add support for ie11

GitOrigin-RevId: ab1280f8da68fa87c266463e617b0a84a48065ce
Jakob Ackermann 6 лет назад
Родитель
Сommit
1a09965503
1 измененных файлов с 10 добавлено и 1 удалено
  1. 10 1
      services/web/frontend/js/ide/connection/ConnectionManager.js

+ 10 - 1
services/web/frontend/js/ide/connection/ConnectionManager.js

@@ -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,
           {