@novnc/novnc 1.3.0-beta → 1.3.0-g721eaa4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -113,8 +113,13 @@ proxy.
113
113
  used to specify the location of a running VNC server:
114
114
 
115
115
  `./utils/novnc_proxy --vnc localhost:5901`
116
+
117
+ * If you don't need to expose the web server to public internet, you can
118
+ bind to localhost:
119
+
120
+ `./utils/novnc_proxy --vnc localhost:5901 --listen localhost:6081`
116
121
 
117
- * Point your browser to the cut-and-paste URL that is output by the `novnc_procy`
122
+ * Point your browser to the cut-and-paste URL that is output by the `novnc_proxy`
118
123
  script. Hit the Connect button, enter a password if the VNC server has one
119
124
  configured, and enjoy!
120
125
 
@@ -0,0 +1,185 @@
1
+ /*
2
+ * noVNC: HTML5 VNC client
3
+ * Copyright (C) 2021 The noVNC Authors
4
+ * Licensed under MPL 2.0 (see LICENSE.txt)
5
+ *
6
+ * See README.md for usage and integration instructions.
7
+ *
8
+ */
9
+
10
+ import Inflate from "../inflator.js";
11
+
12
+ const ZRLE_TILE_WIDTH = 64;
13
+ const ZRLE_TILE_HEIGHT = 64;
14
+
15
+ export default class ZRLEDecoder {
16
+ constructor() {
17
+ this._length = 0;
18
+ this._inflator = new Inflate();
19
+
20
+ this._pixelBuffer = new Uint8Array(ZRLE_TILE_WIDTH * ZRLE_TILE_HEIGHT * 4);
21
+ this._tileBuffer = new Uint8Array(ZRLE_TILE_WIDTH * ZRLE_TILE_HEIGHT * 4);
22
+ }
23
+
24
+ decodeRect(x, y, width, height, sock, display, depth) {
25
+ if (this._length === 0) {
26
+ if (sock.rQwait("ZLib data length", 4)) {
27
+ return false;
28
+ }
29
+ this._length = sock.rQshift32();
30
+ }
31
+ if (sock.rQwait("Zlib data", this._length)) {
32
+ return false;
33
+ }
34
+
35
+ const data = sock.rQshiftBytes(this._length);
36
+
37
+ this._inflator.setInput(data);
38
+
39
+ for (let ty = y; ty < y + height; ty += ZRLE_TILE_HEIGHT) {
40
+ let th = Math.min(ZRLE_TILE_HEIGHT, y + height - ty);
41
+
42
+ for (let tx = x; tx < x + width; tx += ZRLE_TILE_WIDTH) {
43
+ let tw = Math.min(ZRLE_TILE_WIDTH, x + width - tx);
44
+
45
+ const tileSize = tw * th;
46
+ const subencoding = this._inflator.inflate(1)[0];
47
+ if (subencoding === 0) {
48
+ // raw data
49
+ const data = this._readPixels(tileSize);
50
+ display.blitImage(tx, ty, tw, th, data, 0, false);
51
+ } else if (subencoding === 1) {
52
+ // solid
53
+ const background = this._readPixels(1);
54
+ display.fillRect(tx, ty, tw, th, [background[0], background[1], background[2]]);
55
+ } else if (subencoding >= 2 && subencoding <= 16) {
56
+ const data = this._decodePaletteTile(subencoding, tileSize, tw, th);
57
+ display.blitImage(tx, ty, tw, th, data, 0, false);
58
+ } else if (subencoding === 128) {
59
+ const data = this._decodeRLETile(tileSize);
60
+ display.blitImage(tx, ty, tw, th, data, 0, false);
61
+ } else if (subencoding >= 130 && subencoding <= 255) {
62
+ const data = this._decodeRLEPaletteTile(subencoding - 128, tileSize);
63
+ display.blitImage(tx, ty, tw, th, data, 0, false);
64
+ } else {
65
+ throw new Error('Unknown subencoding: ' + subencoding);
66
+ }
67
+ }
68
+ }
69
+ this._length = 0;
70
+ return true;
71
+ }
72
+
73
+ _getBitsPerPixelInPalette(paletteSize) {
74
+ if (paletteSize <= 2) {
75
+ return 1;
76
+ } else if (paletteSize <= 4) {
77
+ return 2;
78
+ } else if (paletteSize <= 16) {
79
+ return 4;
80
+ }
81
+ }
82
+
83
+ _readPixels(pixels) {
84
+ let data = this._pixelBuffer;
85
+ const buffer = this._inflator.inflate(3*pixels);
86
+ for (let i = 0, j = 0; i < pixels*4; i += 4, j += 3) {
87
+ data[i] = buffer[j];
88
+ data[i + 1] = buffer[j + 1];
89
+ data[i + 2] = buffer[j + 2];
90
+ data[i + 3] = 255; // Add the Alpha
91
+ }
92
+ return data;
93
+ }
94
+
95
+ _decodePaletteTile(paletteSize, tileSize, tilew, tileh) {
96
+ const data = this._tileBuffer;
97
+ const palette = this._readPixels(paletteSize);
98
+ const bitsPerPixel = this._getBitsPerPixelInPalette(paletteSize);
99
+ const mask = (1 << bitsPerPixel) - 1;
100
+
101
+ let offset = 0;
102
+ let encoded = this._inflator.inflate(1)[0];
103
+
104
+ for (let y=0; y<tileh; y++) {
105
+ let shift = 8-bitsPerPixel;
106
+ for (let x=0; x<tilew; x++) {
107
+ if (shift<0) {
108
+ shift=8-bitsPerPixel;
109
+ encoded = this._inflator.inflate(1)[0];
110
+ }
111
+ let indexInPalette = (encoded>>shift) & mask;
112
+
113
+ data[offset] = palette[indexInPalette * 4];
114
+ data[offset + 1] = palette[indexInPalette * 4 + 1];
115
+ data[offset + 2] = palette[indexInPalette * 4 + 2];
116
+ data[offset + 3] = palette[indexInPalette * 4 + 3];
117
+ offset += 4;
118
+ shift-=bitsPerPixel;
119
+ }
120
+ if (shift<8-bitsPerPixel && y<tileh-1) {
121
+ encoded = this._inflator.inflate(1)[0];
122
+ }
123
+ }
124
+ return data;
125
+ }
126
+
127
+ _decodeRLETile(tileSize) {
128
+ const data = this._tileBuffer;
129
+ let i = 0;
130
+ while (i < tileSize) {
131
+ const pixel = this._readPixels(1);
132
+ const length = this._readRLELength();
133
+ for (let j = 0; j < length; j++) {
134
+ data[i * 4] = pixel[0];
135
+ data[i * 4 + 1] = pixel[1];
136
+ data[i * 4 + 2] = pixel[2];
137
+ data[i * 4 + 3] = pixel[3];
138
+ i++;
139
+ }
140
+ }
141
+ return data;
142
+ }
143
+
144
+ _decodeRLEPaletteTile(paletteSize, tileSize) {
145
+ const data = this._tileBuffer;
146
+
147
+ // palette
148
+ const palette = this._readPixels(paletteSize);
149
+
150
+ let offset = 0;
151
+ while (offset < tileSize) {
152
+ let indexInPalette = this._inflator.inflate(1)[0];
153
+ let length = 1;
154
+ if (indexInPalette >= 128) {
155
+ indexInPalette -= 128;
156
+ length = this._readRLELength();
157
+ }
158
+ if (indexInPalette > paletteSize) {
159
+ throw new Error('Too big index in palette: ' + indexInPalette + ', palette size: ' + paletteSize);
160
+ }
161
+ if (offset + length > tileSize) {
162
+ throw new Error('Too big rle length in palette mode: ' + length + ', allowed length is: ' + (tileSize - offset));
163
+ }
164
+
165
+ for (let j = 0; j < length; j++) {
166
+ data[offset * 4] = palette[indexInPalette * 4];
167
+ data[offset * 4 + 1] = palette[indexInPalette * 4 + 1];
168
+ data[offset * 4 + 2] = palette[indexInPalette * 4 + 2];
169
+ data[offset * 4 + 3] = palette[indexInPalette * 4 + 3];
170
+ offset++;
171
+ }
172
+ }
173
+ return data;
174
+ }
175
+
176
+ _readRLELength() {
177
+ let length = 0;
178
+ let current = 0;
179
+ do {
180
+ current = this._inflator.inflate(1)[0];
181
+ length += current;
182
+ } while (current === 255);
183
+ return length + 1;
184
+ }
185
+ }
package/core/encodings.js CHANGED
@@ -12,6 +12,7 @@ export const encodings = {
12
12
  encodingRRE: 2,
13
13
  encodingHextile: 5,
14
14
  encodingTight: 7,
15
+ encodingZRLE: 16,
15
16
  encodingTightPNG: -260,
16
17
 
17
18
  pseudoEncodingQualityLevel9: -23,
@@ -38,6 +39,7 @@ export function encodingName(num) {
38
39
  case encodings.encodingRRE: return "RRE";
39
40
  case encodings.encodingHextile: return "Hextile";
40
41
  case encodings.encodingTight: return "Tight";
42
+ case encodings.encodingZRLE: return "ZRLE";
41
43
  case encodings.encodingTightPNG: return "TightPNG";
42
44
  default: return "[unknown encoding " + num + "]";
43
45
  }
package/core/rfb.js CHANGED
@@ -32,6 +32,7 @@ import RREDecoder from "./decoders/rre.js";
32
32
  import HextileDecoder from "./decoders/hextile.js";
33
33
  import TightDecoder from "./decoders/tight.js";
34
34
  import TightPNGDecoder from "./decoders/tightpng.js";
35
+ import ZRLEDecoder from "./decoders/zrle.js";
35
36
 
36
37
  // How many seconds to wait for a disconnect to finish
37
38
  const DISCONNECT_TIMEOUT = 3;
@@ -218,6 +219,7 @@ export default class RFB extends EventTargetMixin {
218
219
  this._decoders[encodings.encodingHextile] = new HextileDecoder();
219
220
  this._decoders[encodings.encodingTight] = new TightDecoder();
220
221
  this._decoders[encodings.encodingTightPNG] = new TightPNGDecoder();
222
+ this._decoders[encodings.encodingZRLE] = new ZRLEDecoder();
221
223
 
222
224
  // NB: nothing that needs explicit teardown should be done
223
225
  // before this point, since this can throw an exception
@@ -432,8 +434,8 @@ export default class RFB extends EventTargetMixin {
432
434
  }
433
435
  }
434
436
 
435
- focus() {
436
- this._canvas.focus();
437
+ focus(options) {
438
+ this._canvas.focus(options);
437
439
  }
438
440
 
439
441
  blur() {
@@ -609,7 +611,7 @@ export default class RFB extends EventTargetMixin {
609
611
  return;
610
612
  }
611
613
 
612
- this.focus();
614
+ this.focus({ preventScroll: true });
613
615
  }
614
616
 
615
617
  _setDesktopName(name) {
@@ -1772,6 +1774,7 @@ export default class RFB extends EventTargetMixin {
1772
1774
  if (this._fbDepth == 24) {
1773
1775
  encs.push(encodings.encodingTight);
1774
1776
  encs.push(encodings.encodingTightPNG);
1777
+ encs.push(encodings.encodingZRLE);
1775
1778
  encs.push(encodings.encodingHextile);
1776
1779
  encs.push(encodings.encodingRRE);
1777
1780
  }
package/docs/API.md CHANGED
@@ -328,7 +328,14 @@ Keyboard events will be sent to the remote server after this point.
328
328
 
329
329
  ##### Syntax
330
330
 
331
- RFB.focus( );
331
+ RFB.focus( [options] );
332
+
333
+ ###### Parameters
334
+
335
+ **`options`** *Optional*
336
+ - A `object` providing options to control how the focus will be
337
+ performed. Please see [`HTMLElement.focus()`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus)
338
+ for available options.
332
339
 
333
340
  #### RFB.blur()
334
341
 
@@ -0,0 +1,234 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ var _inflator = _interopRequireDefault(require("../inflator.js"));
9
+
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
+
12
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
13
+
14
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
15
+
16
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
17
+
18
+ var ZRLE_TILE_WIDTH = 64;
19
+ var ZRLE_TILE_HEIGHT = 64;
20
+
21
+ var ZRLEDecoder = /*#__PURE__*/function () {
22
+ function ZRLEDecoder() {
23
+ _classCallCheck(this, ZRLEDecoder);
24
+
25
+ this._length = 0;
26
+ this._inflator = new _inflator["default"]();
27
+ this._pixelBuffer = new Uint8Array(ZRLE_TILE_WIDTH * ZRLE_TILE_HEIGHT * 4);
28
+ this._tileBuffer = new Uint8Array(ZRLE_TILE_WIDTH * ZRLE_TILE_HEIGHT * 4);
29
+ }
30
+
31
+ _createClass(ZRLEDecoder, [{
32
+ key: "decodeRect",
33
+ value: function decodeRect(x, y, width, height, sock, display, depth) {
34
+ if (this._length === 0) {
35
+ if (sock.rQwait("ZLib data length", 4)) {
36
+ return false;
37
+ }
38
+
39
+ this._length = sock.rQshift32();
40
+ }
41
+
42
+ if (sock.rQwait("Zlib data", this._length)) {
43
+ return false;
44
+ }
45
+
46
+ var data = sock.rQshiftBytes(this._length);
47
+
48
+ this._inflator.setInput(data);
49
+
50
+ for (var ty = y; ty < y + height; ty += ZRLE_TILE_HEIGHT) {
51
+ var th = Math.min(ZRLE_TILE_HEIGHT, y + height - ty);
52
+
53
+ for (var tx = x; tx < x + width; tx += ZRLE_TILE_WIDTH) {
54
+ var tw = Math.min(ZRLE_TILE_WIDTH, x + width - tx);
55
+ var tileSize = tw * th;
56
+
57
+ var subencoding = this._inflator.inflate(1)[0];
58
+
59
+ if (subencoding === 0) {
60
+ // raw data
61
+ var _data = this._readPixels(tileSize);
62
+
63
+ display.blitImage(tx, ty, tw, th, _data, 0, false);
64
+ } else if (subencoding === 1) {
65
+ // solid
66
+ var background = this._readPixels(1);
67
+
68
+ display.fillRect(tx, ty, tw, th, [background[0], background[1], background[2]]);
69
+ } else if (subencoding >= 2 && subencoding <= 16) {
70
+ var _data2 = this._decodePaletteTile(subencoding, tileSize, tw, th);
71
+
72
+ display.blitImage(tx, ty, tw, th, _data2, 0, false);
73
+ } else if (subencoding === 128) {
74
+ var _data3 = this._decodeRLETile(tileSize);
75
+
76
+ display.blitImage(tx, ty, tw, th, _data3, 0, false);
77
+ } else if (subencoding >= 130 && subencoding <= 255) {
78
+ var _data4 = this._decodeRLEPaletteTile(subencoding - 128, tileSize);
79
+
80
+ display.blitImage(tx, ty, tw, th, _data4, 0, false);
81
+ } else {
82
+ throw new Error('Unknown subencoding: ' + subencoding);
83
+ }
84
+ }
85
+ }
86
+
87
+ this._length = 0;
88
+ return true;
89
+ }
90
+ }, {
91
+ key: "_getBitsPerPixelInPalette",
92
+ value: function _getBitsPerPixelInPalette(paletteSize) {
93
+ if (paletteSize <= 2) {
94
+ return 1;
95
+ } else if (paletteSize <= 4) {
96
+ return 2;
97
+ } else if (paletteSize <= 16) {
98
+ return 4;
99
+ }
100
+ }
101
+ }, {
102
+ key: "_readPixels",
103
+ value: function _readPixels(pixels) {
104
+ var data = this._pixelBuffer;
105
+
106
+ var buffer = this._inflator.inflate(3 * pixels);
107
+
108
+ for (var i = 0, j = 0; i < pixels * 4; i += 4, j += 3) {
109
+ data[i] = buffer[j];
110
+ data[i + 1] = buffer[j + 1];
111
+ data[i + 2] = buffer[j + 2];
112
+ data[i + 3] = 255; // Add the Alpha
113
+ }
114
+
115
+ return data;
116
+ }
117
+ }, {
118
+ key: "_decodePaletteTile",
119
+ value: function _decodePaletteTile(paletteSize, tileSize, tilew, tileh) {
120
+ var data = this._tileBuffer;
121
+
122
+ var palette = this._readPixels(paletteSize);
123
+
124
+ var bitsPerPixel = this._getBitsPerPixelInPalette(paletteSize);
125
+
126
+ var mask = (1 << bitsPerPixel) - 1;
127
+ var offset = 0;
128
+
129
+ var encoded = this._inflator.inflate(1)[0];
130
+
131
+ for (var y = 0; y < tileh; y++) {
132
+ var shift = 8 - bitsPerPixel;
133
+
134
+ for (var x = 0; x < tilew; x++) {
135
+ if (shift < 0) {
136
+ shift = 8 - bitsPerPixel;
137
+ encoded = this._inflator.inflate(1)[0];
138
+ }
139
+
140
+ var indexInPalette = encoded >> shift & mask;
141
+ data[offset] = palette[indexInPalette * 4];
142
+ data[offset + 1] = palette[indexInPalette * 4 + 1];
143
+ data[offset + 2] = palette[indexInPalette * 4 + 2];
144
+ data[offset + 3] = palette[indexInPalette * 4 + 3];
145
+ offset += 4;
146
+ shift -= bitsPerPixel;
147
+ }
148
+
149
+ if (shift < 8 - bitsPerPixel && y < tileh - 1) {
150
+ encoded = this._inflator.inflate(1)[0];
151
+ }
152
+ }
153
+
154
+ return data;
155
+ }
156
+ }, {
157
+ key: "_decodeRLETile",
158
+ value: function _decodeRLETile(tileSize) {
159
+ var data = this._tileBuffer;
160
+ var i = 0;
161
+
162
+ while (i < tileSize) {
163
+ var pixel = this._readPixels(1);
164
+
165
+ var length = this._readRLELength();
166
+
167
+ for (var j = 0; j < length; j++) {
168
+ data[i * 4] = pixel[0];
169
+ data[i * 4 + 1] = pixel[1];
170
+ data[i * 4 + 2] = pixel[2];
171
+ data[i * 4 + 3] = pixel[3];
172
+ i++;
173
+ }
174
+ }
175
+
176
+ return data;
177
+ }
178
+ }, {
179
+ key: "_decodeRLEPaletteTile",
180
+ value: function _decodeRLEPaletteTile(paletteSize, tileSize) {
181
+ var data = this._tileBuffer; // palette
182
+
183
+ var palette = this._readPixels(paletteSize);
184
+
185
+ var offset = 0;
186
+
187
+ while (offset < tileSize) {
188
+ var indexInPalette = this._inflator.inflate(1)[0];
189
+
190
+ var length = 1;
191
+
192
+ if (indexInPalette >= 128) {
193
+ indexInPalette -= 128;
194
+ length = this._readRLELength();
195
+ }
196
+
197
+ if (indexInPalette > paletteSize) {
198
+ throw new Error('Too big index in palette: ' + indexInPalette + ', palette size: ' + paletteSize);
199
+ }
200
+
201
+ if (offset + length > tileSize) {
202
+ throw new Error('Too big rle length in palette mode: ' + length + ', allowed length is: ' + (tileSize - offset));
203
+ }
204
+
205
+ for (var j = 0; j < length; j++) {
206
+ data[offset * 4] = palette[indexInPalette * 4];
207
+ data[offset * 4 + 1] = palette[indexInPalette * 4 + 1];
208
+ data[offset * 4 + 2] = palette[indexInPalette * 4 + 2];
209
+ data[offset * 4 + 3] = palette[indexInPalette * 4 + 3];
210
+ offset++;
211
+ }
212
+ }
213
+
214
+ return data;
215
+ }
216
+ }, {
217
+ key: "_readRLELength",
218
+ value: function _readRLELength() {
219
+ var length = 0;
220
+ var current = 0;
221
+
222
+ do {
223
+ current = this._inflator.inflate(1)[0];
224
+ length += current;
225
+ } while (current === 255);
226
+
227
+ return length + 1;
228
+ }
229
+ }]);
230
+
231
+ return ZRLEDecoder;
232
+ }();
233
+
234
+ exports["default"] = ZRLEDecoder;
package/lib/encodings.js CHANGED
@@ -19,6 +19,7 @@ var encodings = {
19
19
  encodingRRE: 2,
20
20
  encodingHextile: 5,
21
21
  encodingTight: 7,
22
+ encodingZRLE: 16,
22
23
  encodingTightPNG: -260,
23
24
  pseudoEncodingQualityLevel9: -23,
24
25
  pseudoEncodingQualityLevel0: -32,
@@ -55,6 +56,9 @@ function encodingName(num) {
55
56
  case encodings.encodingTight:
56
57
  return "Tight";
57
58
 
59
+ case encodings.encodingZRLE:
60
+ return "ZRLE";
61
+
58
62
  case encodings.encodingTightPNG:
59
63
  return "TightPNG";
60
64
 
package/lib/input/util.js CHANGED
@@ -5,8 +5,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.getKeycode = getKeycode;
9
8
  exports.getKey = getKey;
9
+ exports.getKeycode = getKeycode;
10
10
  exports.getKeysym = getKeysym;
11
11
 
12
12
  var _keysym = _interopRequireDefault(require("./keysym.js"));
package/lib/rfb.js CHANGED
@@ -55,6 +55,8 @@ var _tight = _interopRequireDefault(require("./decoders/tight.js"));
55
55
 
56
56
  var _tightpng = _interopRequireDefault(require("./decoders/tightpng.js"));
57
57
 
58
+ var _zrle = _interopRequireDefault(require("./decoders/zrle.js"));
59
+
58
60
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
59
61
 
60
62
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -262,7 +264,8 @@ var RFB = /*#__PURE__*/function (_EventTargetMixin) {
262
264
  _this._decoders[_encodings.encodings.encodingRRE] = new _rre["default"]();
263
265
  _this._decoders[_encodings.encodings.encodingHextile] = new _hextile["default"]();
264
266
  _this._decoders[_encodings.encodings.encodingTight] = new _tight["default"]();
265
- _this._decoders[_encodings.encodings.encodingTightPNG] = new _tightpng["default"](); // NB: nothing that needs explicit teardown should be done
267
+ _this._decoders[_encodings.encodings.encodingTightPNG] = new _tightpng["default"]();
268
+ _this._decoders[_encodings.encodings.encodingZRLE] = new _zrle["default"](); // NB: nothing that needs explicit teardown should be done
266
269
  // before this point, since this can throw an exception
267
270
 
268
271
  try {
@@ -522,8 +525,8 @@ var RFB = /*#__PURE__*/function (_EventTargetMixin) {
522
525
  }
523
526
  }, {
524
527
  key: "focus",
525
- value: function focus() {
526
- this._canvas.focus();
528
+ value: function focus(options) {
529
+ this._canvas.focus(options);
527
530
  }
528
531
  }, {
529
532
  key: "blur",
@@ -746,7 +749,9 @@ var RFB = /*#__PURE__*/function (_EventTargetMixin) {
746
749
  return;
747
750
  }
748
751
 
749
- this.focus();
752
+ this.focus({
753
+ preventScroll: true
754
+ });
750
755
  }
751
756
  }, {
752
757
  key: "_setDesktopName",
@@ -2150,6 +2155,7 @@ var RFB = /*#__PURE__*/function (_EventTargetMixin) {
2150
2155
  if (this._fbDepth == 24) {
2151
2156
  encs.push(_encodings.encodings.encodingTight);
2152
2157
  encs.push(_encodings.encodings.encodingTightPNG);
2158
+ encs.push(_encodings.encodings.encodingZRLE);
2153
2159
  encs.push(_encodings.encodings.encodingHextile);
2154
2160
  encs.push(_encodings.encodings.encodingRRE);
2155
2161
  }
@@ -5,12 +5,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.isMac = isMac;
9
- exports.isWindows = isWindows;
8
+ exports.hasScrollbarGutter = exports.dragThreshold = void 0;
9
+ exports.isFirefox = isFirefox;
10
10
  exports.isIOS = isIOS;
11
+ exports.isMac = isMac;
11
12
  exports.isSafari = isSafari;
12
- exports.isFirefox = isFirefox;
13
- exports.hasScrollbarGutter = exports.supportsCursorURIs = exports.dragThreshold = exports.isTouchDevice = void 0;
13
+ exports.isTouchDevice = void 0;
14
+ exports.isWindows = isWindows;
15
+ exports.supportsCursorURIs = void 0;
14
16
 
15
17
  var Log = _interopRequireWildcard(require("./logging.js"));
16
18
 
@@ -28,7 +30,9 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
28
30
  * Browser feature support detection
29
31
  */
30
32
  // Touch detection
31
- var isTouchDevice = 'ontouchstart' in document.documentElement || document.ontouchstart !== undefined || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
33
+ var isTouchDevice = 'ontouchstart' in document.documentElement || // requried for Chrome debugger
34
+ document.ontouchstart !== undefined || // required for MS Surface
35
+ navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
32
36
  exports.isTouchDevice = isTouchDevice;
33
37
  window.addEventListener('touchstart', function onFirstTouch() {
34
38
  exports.isTouchDevice = isTouchDevice = true;
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getPointerEvent = getPointerEvent;
7
- exports.stopEvent = stopEvent;
8
- exports.setCapture = setCapture;
9
7
  exports.releaseCapture = releaseCapture;
8
+ exports.setCapture = setCapture;
9
+ exports.stopEvent = stopEvent;
10
10
 
11
11
  /*
12
12
  * noVNC: HTML5 VNC client
package/lib/util/int.js CHANGED
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.toUnsigned32bit = toUnsigned32bit;
7
6
  exports.toSigned32bit = toSigned32bit;
7
+ exports.toUnsigned32bit = toUnsigned32bit;
8
8
 
9
9
  /*
10
10
  * noVNC: HTML5 VNC client
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.initLogging = initLogging;
6
+ exports.Warn = exports.Info = exports.Error = exports.Debug = void 0;
7
7
  exports.getLogging = getLogging;
8
- exports.Error = exports.Warn = exports.Info = exports.Debug = void 0;
8
+ exports.initLogging = initLogging;
9
9
 
10
10
  /*
11
11
  * noVNC: HTML5 VNC client
@@ -3,10 +3,10 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.shrinkBuf = shrinkBuf;
6
+ exports.Buf8 = exports.Buf32 = exports.Buf16 = void 0;
7
7
  exports.arraySet = arraySet;
8
8
  exports.flattenChunks = flattenChunks;
9
- exports.Buf32 = exports.Buf16 = exports.Buf8 = void 0;
9
+ exports.shrinkBuf = shrinkBuf;
10
10
 
11
11
  // reduce buffer size, avoiding mem copy
12
12
  function shrinkBuf(buf, size) {
@@ -5,15 +5,16 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
+ exports.Z_UNKNOWN = exports.Z_STREAM_ERROR = exports.Z_STREAM_END = exports.Z_RLE = exports.Z_PARTIAL_FLUSH = exports.Z_OK = exports.Z_NO_FLUSH = exports.Z_HUFFMAN_ONLY = exports.Z_FULL_FLUSH = exports.Z_FIXED = exports.Z_FINISH = exports.Z_FILTERED = exports.Z_DEFLATED = exports.Z_DEFAULT_STRATEGY = exports.Z_DEFAULT_COMPRESSION = exports.Z_DATA_ERROR = exports.Z_BUF_ERROR = exports.Z_BLOCK = void 0;
9
+ exports.deflate = deflate;
10
+ exports.deflateEnd = deflateEnd;
11
+ exports.deflateInfo = void 0;
8
12
  exports.deflateInit = deflateInit;
9
13
  exports.deflateInit2 = deflateInit2;
10
14
  exports.deflateReset = deflateReset;
11
15
  exports.deflateResetKeep = deflateResetKeep;
12
- exports.deflateSetHeader = deflateSetHeader;
13
- exports.deflate = deflate;
14
- exports.deflateEnd = deflateEnd;
15
16
  exports.deflateSetDictionary = deflateSetDictionary;
16
- exports.deflateInfo = exports.Z_DEFLATED = exports.Z_UNKNOWN = exports.Z_DEFAULT_STRATEGY = exports.Z_FIXED = exports.Z_RLE = exports.Z_HUFFMAN_ONLY = exports.Z_FILTERED = exports.Z_DEFAULT_COMPRESSION = exports.Z_BUF_ERROR = exports.Z_DATA_ERROR = exports.Z_STREAM_ERROR = exports.Z_STREAM_END = exports.Z_OK = exports.Z_BLOCK = exports.Z_FINISH = exports.Z_FULL_FLUSH = exports.Z_PARTIAL_FLUSH = exports.Z_NO_FLUSH = void 0;
17
+ exports.deflateSetHeader = deflateSetHeader;
17
18
 
18
19
  var utils = _interopRequireWildcard(require("../utils/common.js"));
19
20
 
@@ -392,7 +392,9 @@ function inflate_fast(strm, start) {
392
392
  }
393
393
  } else if ((op & 64) === 0) {
394
394
  /* 2nd level distance code */
395
- here = dcode[(here & 0xffff) + (hold & (1 << op) - 1)];
395
+ here = dcode[(here & 0xffff
396
+ /*here.val*/
397
+ ) + (hold & (1 << op) - 1)];
396
398
  continue dodist;
397
399
  } else {
398
400
  strm.msg = 'invalid distance code';
@@ -404,7 +406,9 @@ function inflate_fast(strm, start) {
404
406
  }
405
407
  } else if ((op & 64) === 0) {
406
408
  /* 2nd level length code */
407
- here = lcode[(here & 0xffff) + (hold & (1 << op) - 1)];
409
+ here = lcode[(here & 0xffff
410
+ /*here.val*/
411
+ ) + (hold & (1 << op) - 1)];
408
412
  continue dolen;
409
413
  } else if (op & 32) {
410
414
  /* end-of-block */
@@ -5,16 +5,17 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.inflateReset = inflateReset;
9
- exports.inflateReset2 = inflateReset2;
10
- exports.inflateResetKeep = inflateResetKeep;
11
- exports.inflateInit = inflateInit;
12
- exports.inflateInit2 = inflateInit2;
8
+ exports.Z_TREES = exports.Z_STREAM_ERROR = exports.Z_STREAM_END = exports.Z_OK = exports.Z_NEED_DICT = exports.Z_MEM_ERROR = exports.Z_FINISH = exports.Z_DEFLATED = exports.Z_DATA_ERROR = exports.Z_BUF_ERROR = exports.Z_BLOCK = void 0;
13
9
  exports.inflate = inflate;
14
10
  exports.inflateEnd = inflateEnd;
15
11
  exports.inflateGetHeader = inflateGetHeader;
12
+ exports.inflateInfo = void 0;
13
+ exports.inflateInit = inflateInit;
14
+ exports.inflateInit2 = inflateInit2;
15
+ exports.inflateReset = inflateReset;
16
+ exports.inflateReset2 = inflateReset2;
17
+ exports.inflateResetKeep = inflateResetKeep;
16
18
  exports.inflateSetDictionary = inflateSetDictionary;
17
- exports.inflateInfo = exports.Z_DEFLATED = exports.Z_BUF_ERROR = exports.Z_MEM_ERROR = exports.Z_DATA_ERROR = exports.Z_STREAM_ERROR = exports.Z_NEED_DICT = exports.Z_STREAM_END = exports.Z_OK = exports.Z_TREES = exports.Z_BLOCK = exports.Z_FINISH = void 0;
18
19
 
19
20
  var utils = _interopRequireWildcard(require("../utils/common.js"));
20
21
 
@@ -693,13 +694,17 @@ function inflate(strm, flush) {
693
694
 
694
695
  if (!(state.wrap & 1) ||
695
696
  /* check if zlib header allowed */
696
- (((hold & 0xff) << 8) + (hold >> 8)) % 31) {
697
+ (((hold & 0xff
698
+ /*BITS(8)*/
699
+ ) << 8) + (hold >> 8)) % 31) {
697
700
  strm.msg = 'incorrect header check';
698
701
  state.mode = BAD;
699
702
  break;
700
703
  }
701
704
 
702
- if ((hold & 0x0f) !== Z_DEFLATED) {
705
+ if ((hold & 0x0f
706
+ /*BITS(4)*/
707
+ ) !== Z_DEFLATED) {
703
708
  strm.msg = 'unknown compression method';
704
709
  state.mode = BAD;
705
710
  break;
@@ -709,7 +714,9 @@ function inflate(strm, flush) {
709
714
  hold >>>= 4;
710
715
  bits -= 4; //---//
711
716
 
712
- len = (hold & 0x0f) + 8;
717
+ len = (hold & 0x0f
718
+ /*BITS(4)*/
719
+ ) + 8;
713
720
 
714
721
  if (state.wbits === 0) {
715
722
  state.wbits = len;
@@ -1117,7 +1124,9 @@ function inflate(strm, flush) {
1117
1124
  hold >>>= 1;
1118
1125
  bits -= 1; //---//
1119
1126
 
1120
- switch (hold & 0x03) {
1127
+ switch (hold & 0x03
1128
+ /*BITS(2)*/
1129
+ ) {
1121
1130
  case 0:
1122
1131
  /* stored block */
1123
1132
  //Tracev((stderr, "inflate: stored block%s\n",
@@ -1248,17 +1257,23 @@ function inflate(strm, flush) {
1248
1257
  } //===//
1249
1258
 
1250
1259
 
1251
- state.nlen = (hold & 0x1f) + 257; //--- DROPBITS(5) ---//
1260
+ state.nlen = (hold & 0x1f
1261
+ /*BITS(5)*/
1262
+ ) + 257; //--- DROPBITS(5) ---//
1252
1263
 
1253
1264
  hold >>>= 5;
1254
1265
  bits -= 5; //---//
1255
1266
 
1256
- state.ndist = (hold & 0x1f) + 1; //--- DROPBITS(5) ---//
1267
+ state.ndist = (hold & 0x1f
1268
+ /*BITS(5)*/
1269
+ ) + 1; //--- DROPBITS(5) ---//
1257
1270
 
1258
1271
  hold >>>= 5;
1259
1272
  bits -= 5; //---//
1260
1273
 
1261
- state.ncode = (hold & 0x0f) + 4; //--- DROPBITS(4) ---//
1274
+ state.ncode = (hold & 0x0f
1275
+ /*BITS(4)*/
1276
+ ) + 4; //--- DROPBITS(4) ---//
1262
1277
 
1263
1278
  hold >>>= 4;
1264
1279
  bits -= 4; //---//
@@ -1575,7 +1590,9 @@ function inflate(strm, flush) {
1575
1590
  last_val = here_val;
1576
1591
 
1577
1592
  for (;;) {
1578
- here = state.lencode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)];
1593
+ here = state.lencode[last_val + ((hold & (1 << last_bits + last_op) - 1
1594
+ /*BITS(last.bits + last.op)*/
1595
+ ) >> last_bits)];
1579
1596
  here_bits = here >>> 24;
1580
1597
  here_op = here >>> 16 & 0xff;
1581
1598
  here_val = here & 0xffff;
@@ -1695,7 +1712,9 @@ function inflate(strm, flush) {
1695
1712
  last_val = here_val;
1696
1713
 
1697
1714
  for (;;) {
1698
- here = state.distcode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)];
1715
+ here = state.distcode[last_val + ((hold & (1 << last_bits + last_op) - 1
1716
+ /*BITS(last.bits + last.op)*/
1717
+ ) >> last_bits)];
1699
1718
  here_bits = here >>> 24;
1700
1719
  here_op = here >>> 16 & 0xff;
1701
1720
  here_val = here & 0xffff;
@@ -1878,7 +1897,9 @@ function inflate(strm, flush) {
1878
1897
  state.total += _out;
1879
1898
 
1880
1899
  if (_out) {
1881
- strm.adler = state.check = state.flags ? (0, _crc["default"])(state.check, output, _out, put - _out) : (0, _adler["default"])(state.check, output, _out, put - _out);
1900
+ strm.adler = state.check =
1901
+ /*UPDATE(state.check, put - _out, _out);*/
1902
+ state.flags ? (0, _crc["default"])(state.check, output, _out, put - _out) : (0, _adler["default"])(state.check, output, _out, put - _out);
1882
1903
  }
1883
1904
 
1884
1905
  _out = left; // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too
@@ -1978,7 +1999,9 @@ function inflate(strm, flush) {
1978
1999
  state.total += _out;
1979
2000
 
1980
2001
  if (state.wrap && _out) {
1981
- strm.adler = state.check = state.flags ? (0, _crc["default"])(state.check, output, _out, strm.next_out - _out) : (0, _adler["default"])(state.check, output, _out, strm.next_out - _out);
2002
+ strm.adler = state.check =
2003
+ /*UPDATE(state.check, strm.next_out - _out, _out);*/
2004
+ state.flags ? (0, _crc["default"])(state.check, output, _out, strm.next_out - _out) : (0, _adler["default"])(state.check, output, _out, strm.next_out - _out);
1982
2005
  }
1983
2006
 
1984
2007
  strm.data_type = state.bits + (state.last ? 64 : 0) + (state.mode === TYPE ? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);
@@ -5,11 +5,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
+ exports._tr_align = _tr_align;
9
+ exports._tr_flush_block = _tr_flush_block;
8
10
  exports._tr_init = _tr_init;
9
11
  exports._tr_stored_block = _tr_stored_block;
10
- exports._tr_flush_block = _tr_flush_block;
11
12
  exports._tr_tally = _tr_tally;
12
- exports._tr_align = _tr_align;
13
13
 
14
14
  var utils = _interopRequireWildcard(require("../utils/common.js"));
15
15
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@novnc/novnc",
3
- "version": "1.3.0-beta",
3
+ "version": "1.3.0-g721eaa4",
4
4
  "description": "An HTML5 VNC client",
5
5
  "browser": "lib/rfb",
6
6
  "directories": {
@@ -29,8 +29,6 @@
29
29
  },
30
30
  "author": "Joel Martin <github@martintribe.org> (https://github.com/kanaka)",
31
31
  "contributors": [
32
- "Solly Ross <sross@redhat.com> (https://github.com/directxman12)",
33
- "Peter Åstrand <astrand@cendio.se> (https://github.com/astrand)",
34
32
  "Samuel Mannehed <samuel@cendio.se> (https://github.com/samhed)",
35
33
  "Pierre Ossman <ossman@cendio.se> (https://github.com/CendioOssman)"
36
34
  ],