From: Samuel Mannehed Date: Fri, 15 Jun 2018 10:00:43 +0000 (+0200) Subject: Avoid TypedArray.slice() because of IE11 X-Git-Tag: v1.1.0~66 X-Git-Url: https://git.proxmox.com/?p=mirror_novnc.git;a=commitdiff_plain;h=f90c2a6d4b89e8586949e2dc0fc0d530427567a0 Avoid TypedArray.slice() because of IE11 --- diff --git a/core/websock.js b/core/websock.js index 8039fb8..fc77dd0 100644 --- a/core/websock.js +++ b/core/websock.js @@ -100,11 +100,10 @@ Websock.prototype = { rQshiftStr: function (len) { if (typeof(len) === 'undefined') { len = this.rQlen(); } - const arr = this.rQshiftBytes(len); let str = ""; // Handle large arrays in steps to avoid long strings on the stack for (let i = 0; i < len; i += 4096) { - let part = arr.slice(i, Math.min(i + 4096, len)); + let part = this.rQshiftBytes(Math.min(4096, len - i)); str += String.fromCharCode.apply(null, part); } return str;