@novnc/novnc 1.5.0-g7fcf9dc → 1.5.0-gbbb6a5b

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
@@ -66,7 +66,7 @@ profits such as:
66
66
  RSA-AES, Tight, VeNCrypt Plain, XVP, Apple's Diffie-Hellman,
67
67
  UltraVNC's MSLogonII
68
68
  * Supported VNC encodings: raw, copyrect, rre, hextile, tight, tightPNG,
69
- ZRLE, JPEG
69
+ ZRLE, JPEG, Zlib
70
70
  * Supports scaling, clipping and resizing the desktop
71
71
  * Local cursor rendering
72
72
  * Clipboard copy/paste with full Unicode support
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _inflator = _interopRequireDefault(require("../inflator.js"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
11
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
12
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /*
15
+ * noVNC: HTML5 VNC client
16
+ * Copyright (C) 2024 The noVNC Authors
17
+ * Licensed under MPL 2.0 (see LICENSE.txt)
18
+ *
19
+ * See README.md for usage and integration instructions.
20
+ *
21
+ */
22
+ var ZlibDecoder = exports["default"] = /*#__PURE__*/function () {
23
+ function ZlibDecoder() {
24
+ _classCallCheck(this, ZlibDecoder);
25
+ this._zlib = new _inflator["default"]();
26
+ this._length = 0;
27
+ }
28
+ return _createClass(ZlibDecoder, [{
29
+ key: "decodeRect",
30
+ value: function decodeRect(x, y, width, height, sock, display, depth) {
31
+ if (width === 0 || height === 0) {
32
+ return true;
33
+ }
34
+ if (this._length === 0) {
35
+ if (sock.rQwait("ZLIB", 4)) {
36
+ return false;
37
+ }
38
+ this._length = sock.rQshift32();
39
+ }
40
+ if (sock.rQwait("ZLIB", this._length)) {
41
+ return false;
42
+ }
43
+ var data = new Uint8Array(sock.rQshiftBytes(this._length, false));
44
+ this._length = 0;
45
+ this._zlib.setInput(data);
46
+ data = this._zlib.inflate(width * height * 4);
47
+ this._zlib.setInput(null);
48
+
49
+ // Max sure the image is fully opaque
50
+ for (var i = 0; i < width * height; i++) {
51
+ data[i * 4 + 3] = 255;
52
+ }
53
+ display.blitImage(x, y, width, height, data, 0);
54
+ return true;
55
+ }
56
+ }]);
57
+ }();
package/lib/encodings.js CHANGED
@@ -18,6 +18,7 @@ var encodings = exports.encodings = {
18
18
  encodingCopyRect: 1,
19
19
  encodingRRE: 2,
20
20
  encodingHextile: 5,
21
+ encodingZlib: 6,
21
22
  encodingTight: 7,
22
23
  encodingZRLE: 16,
23
24
  encodingTightPNG: -260,
@@ -49,6 +50,8 @@ function encodingName(num) {
49
50
  return "RRE";
50
51
  case encodings.encodingHextile:
51
52
  return "Hextile";
53
+ case encodings.encodingZlib:
54
+ return "Zlib";
52
55
  case encodings.encodingTight:
53
56
  return "Tight";
54
57
  case encodings.encodingZRLE:
@@ -203,7 +203,7 @@ var Keyboard = exports["default"] = /*#__PURE__*/function () {
203
203
  // Possible start of AltGr sequence? (see above)
204
204
  if (code === "ControlLeft" && browser.isWindows() && !("ControlLeft" in this._keyDownList)) {
205
205
  this._altGrArmed = true;
206
- this._altGrTimeout = setTimeout(this._handleAltGrTimeout.bind(this), 100);
206
+ this._altGrTimeout = setTimeout(this._interruptAltGrSequence.bind(this), 100);
207
207
  this._altGrCtrlTime = e.timeStamp;
208
208
  return;
209
209
  }
@@ -217,11 +217,7 @@ var Keyboard = exports["default"] = /*#__PURE__*/function () {
217
217
 
218
218
  // We can't get a release in the middle of an AltGr sequence, so
219
219
  // abort that detection
220
- if (this._altGrArmed) {
221
- this._altGrArmed = false;
222
- clearTimeout(this._altGrTimeout);
223
- this._sendKeyEvent(_keysym["default"].XK_Control_L, "ControlLeft", true);
224
- }
220
+ this._interruptAltGrSequence();
225
221
 
226
222
  // See comment in _handleKeyDown()
227
223
  if ((browser.isMac() || browser.isIOS()) && code === 'CapsLock') {
@@ -244,16 +240,21 @@ var Keyboard = exports["default"] = /*#__PURE__*/function () {
244
240
  }
245
241
  }
246
242
  }, {
247
- key: "_handleAltGrTimeout",
248
- value: function _handleAltGrTimeout() {
249
- this._altGrArmed = false;
250
- clearTimeout(this._altGrTimeout);
251
- this._sendKeyEvent(_keysym["default"].XK_Control_L, "ControlLeft", true);
243
+ key: "_interruptAltGrSequence",
244
+ value: function _interruptAltGrSequence() {
245
+ if (this._altGrArmed) {
246
+ this._altGrArmed = false;
247
+ clearTimeout(this._altGrTimeout);
248
+ this._sendKeyEvent(_keysym["default"].XK_Control_L, "ControlLeft", true);
249
+ }
252
250
  }
253
251
  }, {
254
252
  key: "_allKeysUp",
255
253
  value: function _allKeysUp() {
256
254
  Log.Debug(">> Keyboard.allKeysUp");
255
+
256
+ // Prevent control key being processed after losing focus.
257
+ this._interruptAltGrSequence();
257
258
  for (var code in this._keyDownList) {
258
259
  this._sendKeyEvent(this._keyDownList[code], code, false);
259
260
  }
package/lib/rfb.js CHANGED
@@ -28,6 +28,7 @@ var _raw = _interopRequireDefault(require("./decoders/raw.js"));
28
28
  var _copyrect = _interopRequireDefault(require("./decoders/copyrect.js"));
29
29
  var _rre = _interopRequireDefault(require("./decoders/rre.js"));
30
30
  var _hextile = _interopRequireDefault(require("./decoders/hextile.js"));
31
+ var _zlib = _interopRequireDefault(require("./decoders/zlib.js"));
31
32
  var _tight = _interopRequireDefault(require("./decoders/tight.js"));
32
33
  var _tightpng = _interopRequireDefault(require("./decoders/tightpng.js"));
33
34
  var _zrle = _interopRequireDefault(require("./decoders/zrle.js"));
@@ -263,6 +264,7 @@ var RFB = exports["default"] = /*#__PURE__*/function (_EventTargetMixin) {
263
264
  _this._decoders[_encodings.encodings.encodingCopyRect] = new _copyrect["default"]();
264
265
  _this._decoders[_encodings.encodings.encodingRRE] = new _rre["default"]();
265
266
  _this._decoders[_encodings.encodings.encodingHextile] = new _hextile["default"]();
267
+ _this._decoders[_encodings.encodings.encodingZlib] = new _zlib["default"]();
266
268
  _this._decoders[_encodings.encodings.encodingTight] = new _tight["default"]();
267
269
  _this._decoders[_encodings.encodings.encodingTightPNG] = new _tightpng["default"]();
268
270
  _this._decoders[_encodings.encodings.encodingZRLE] = new _zrle["default"]();
@@ -2213,6 +2215,7 @@ var RFB = exports["default"] = /*#__PURE__*/function (_EventTargetMixin) {
2213
2215
  encs.push(_encodings.encodings.encodingJPEG);
2214
2216
  encs.push(_encodings.encodings.encodingHextile);
2215
2217
  encs.push(_encodings.encodings.encodingRRE);
2218
+ encs.push(_encodings.encodings.encodingZlib);
2216
2219
  }
2217
2220
  encs.push(_encodings.encodings.encodingRaw);
2218
2221
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@novnc/novnc",
3
- "version": "1.5.0-g7fcf9dc",
3
+ "version": "1.5.0-gbbb6a5b",
4
4
  "description": "An HTML5 VNC client",
5
5
  "browser": "lib/rfb",
6
6
  "directories": {
@@ -55,7 +55,6 @@
55
55
  "karma-mocha-reporter": "latest",
56
56
  "karma-safari-launcher": "latest",
57
57
  "karma-script-launcher": "latest",
58
- "karma-sinon-chai": "latest",
59
58
  "mocha": "latest",
60
59
  "node-getopt": "latest",
61
60
  "po2json": "latest",