[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-cd-3-2' - loleaflet/src

Ashod Nakashian ashod.nakashian at collabora.co.uk
Thu Jul 12 21:53:15 UTC 2018


 loleaflet/src/core/Socket.js |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 59c62ea37de820b3a44da575345bcc35213a1a83
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Thu Jul 12 08:25:04 2018 -0400

    leaflet: detect WebSocket failure on IE11 and inform user
    
    IE 11 has limitation on the number of WebSockets open
    to a signle domain, 6 by default. Once the limitation
    hit, creating a new WebSocket throws exception
    (SecurityError).
    
    This detects IE11 and lets the user know about this
    limitation and how to extend it.
    
    Change-Id: I8119fe35e0d460f1a52251d3f4bcd5136992c224
    Reviewed-on: https://gerrit.libreoffice.org/57340
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index aae9f0f89..eb93d1f2f 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -35,7 +35,14 @@ L.Socket = L.Class.extend({
 		try {
 			this.socket = new WebSocket(map.options.server + '/lool/' + encodeURIComponent(map.options.doc + '?' + $.param(map.options.docParams)) + '/ws' + wopiSrc);
 		} catch (e) {
-			this._map.fire('error', {msg: _('Oops, there is a problem connecting to LibreOffice Online : ').replace('LibreOffice Online', (typeof brandProductName !== 'undefined' ? brandProductName : 'LibreOffice Online')) + e, cmd: 'socket', kind: 'failed', id: 3});
+			// On IE 11 there is a limiation on the number of WebSockets open to a single domain (6 by default and can go to 128).
+			// Detect this and hint the user.
+			var msgHint = '';
+			var isIE11 = !!window.MSInputMethodContext && !!document.documentMode; // https://stackoverflow.com/questions/21825157/internet-explorer-11-detection
+			if (isIE11)
+				msgHint = 'Note: IE11 has limitation on the maximum number of WebSockets open to a single domain. Please consult this page on how to change this limit: https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/general-info/ee330736(v=vs.85)#websocket-maximum-server-connections';
+
+			this._map.fire('error', {msg: _('Oops, there is a problem connecting to LibreOffice Online : ').replace('LibreOffice Online', (typeof brandProductName !== 'undefined' ? brandProductName : 'LibreOffice Online')) + e + msgHint, cmd: 'socket', kind: 'failed', id: 3});
 			return;
 		}
 


More information about the Libreoffice-commits mailing list