@novnc/novnc 1.6.0 → 1.7.0

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.
Files changed (103) hide show
  1. package/core/base64.js +104 -0
  2. package/core/crypto/aes.js +178 -0
  3. package/core/crypto/bigint.js +34 -0
  4. package/core/crypto/crypto.js +90 -0
  5. package/core/crypto/des.js +330 -0
  6. package/core/crypto/dh.js +55 -0
  7. package/core/crypto/md5.js +82 -0
  8. package/core/crypto/rsa.js +132 -0
  9. package/core/decoders/copyrect.js +27 -0
  10. package/core/decoders/h264.js +321 -0
  11. package/core/decoders/hextile.js +181 -0
  12. package/core/decoders/jpeg.js +161 -0
  13. package/core/decoders/raw.js +59 -0
  14. package/core/decoders/rre.js +44 -0
  15. package/core/decoders/tight.js +393 -0
  16. package/core/decoders/tightpng.js +27 -0
  17. package/core/decoders/zlib.js +51 -0
  18. package/core/decoders/zrle.js +185 -0
  19. package/core/deflator.js +84 -0
  20. package/core/display.js +578 -0
  21. package/core/encodings.js +54 -0
  22. package/core/inflator.js +65 -0
  23. package/core/input/domkeytable.js +311 -0
  24. package/core/input/fixedkeys.js +129 -0
  25. package/core/input/gesturehandler.js +567 -0
  26. package/core/input/keyboard.js +294 -0
  27. package/core/input/keysym.js +616 -0
  28. package/core/input/keysymdef.js +688 -0
  29. package/core/input/util.js +191 -0
  30. package/core/input/vkeys.js +116 -0
  31. package/core/input/xtscancodes.js +173 -0
  32. package/core/ra2.js +312 -0
  33. package/core/rfb.js +3411 -0
  34. package/core/util/browser.js +233 -0
  35. package/core/util/cursor.js +249 -0
  36. package/core/util/element.js +32 -0
  37. package/core/util/events.js +138 -0
  38. package/core/util/eventtarget.js +35 -0
  39. package/core/util/int.js +15 -0
  40. package/core/util/logging.js +56 -0
  41. package/core/util/strings.js +28 -0
  42. package/core/websock.js +369 -0
  43. package/docs/API.md +0 -5
  44. package/package.json +6 -10
  45. package/vendor/pako/LICENSE +21 -0
  46. package/vendor/pako/README.md +6 -0
  47. package/{lib/vendor → vendor}/pako/lib/utils/common.js +13 -23
  48. package/{lib/vendor → vendor}/pako/lib/zlib/adler32.js +12 -14
  49. package/vendor/pako/lib/zlib/constants.js +47 -0
  50. package/{lib/vendor → vendor}/pako/lib/zlib/crc32.js +15 -14
  51. package/{lib/vendor → vendor}/pako/lib/zlib/deflate.js +459 -334
  52. package/{lib/vendor → vendor}/pako/lib/zlib/gzheader.js +13 -19
  53. package/{lib/vendor → vendor}/pako/lib/zlib/inffast.js +116 -119
  54. package/vendor/pako/lib/zlib/inflate.js +1527 -0
  55. package/{lib/vendor → vendor}/pako/lib/zlib/inftrees.js +103 -91
  56. package/vendor/pako/lib/zlib/messages.js +11 -0
  57. package/{lib/vendor → vendor}/pako/lib/zlib/trees.js +313 -268
  58. package/{lib/vendor → vendor}/pako/lib/zlib/zstream.js +4 -10
  59. package/lib/base64.js +0 -100
  60. package/lib/crypto/aes.js +0 -481
  61. package/lib/crypto/bigint.js +0 -41
  62. package/lib/crypto/crypto.js +0 -109
  63. package/lib/crypto/des.js +0 -374
  64. package/lib/crypto/dh.js +0 -81
  65. package/lib/crypto/md5.js +0 -97
  66. package/lib/crypto/rsa.js +0 -312
  67. package/lib/decoders/copyrect.js +0 -40
  68. package/lib/decoders/h264.js +0 -349
  69. package/lib/decoders/hextile.js +0 -195
  70. package/lib/decoders/jpeg.js +0 -175
  71. package/lib/decoders/raw.js +0 -66
  72. package/lib/decoders/rre.js +0 -52
  73. package/lib/decoders/tight.js +0 -363
  74. package/lib/decoders/tightpng.js +0 -51
  75. package/lib/decoders/zlib.js +0 -57
  76. package/lib/decoders/zrle.js +0 -192
  77. package/lib/deflator.js +0 -88
  78. package/lib/display.js +0 -588
  79. package/lib/encodings.js +0 -70
  80. package/lib/inflator.js +0 -77
  81. package/lib/input/domkeytable.js +0 -313
  82. package/lib/input/fixedkeys.js +0 -127
  83. package/lib/input/gesturehandler.js +0 -573
  84. package/lib/input/keyboard.js +0 -293
  85. package/lib/input/keysym.js +0 -878
  86. package/lib/input/keysymdef.js +0 -1351
  87. package/lib/input/util.js +0 -217
  88. package/lib/input/vkeys.js +0 -121
  89. package/lib/input/xtscancodes.js +0 -343
  90. package/lib/ra2.js +0 -535
  91. package/lib/rfb.js +0 -3398
  92. package/lib/util/browser.js +0 -239
  93. package/lib/util/cursor.js +0 -269
  94. package/lib/util/element.js +0 -41
  95. package/lib/util/events.js +0 -133
  96. package/lib/util/eventtarget.js +0 -53
  97. package/lib/util/int.js +0 -21
  98. package/lib/util/logging.js +0 -56
  99. package/lib/util/strings.js +0 -36
  100. package/lib/vendor/pako/lib/zlib/constants.js +0 -47
  101. package/lib/vendor/pako/lib/zlib/inflate.js +0 -1602
  102. package/lib/vendor/pako/lib/zlib/messages.js +0 -25
  103. package/lib/websock.js +0 -395
@@ -1,133 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getPointerEvent = getPointerEvent;
7
- exports.releaseCapture = releaseCapture;
8
- exports.setCapture = setCapture;
9
- exports.stopEvent = stopEvent;
10
- /*
11
- * noVNC: HTML5 VNC client
12
- * Copyright (C) 2018 The noVNC authors
13
- * Licensed under MPL 2.0 (see LICENSE.txt)
14
- *
15
- * See README.md for usage and integration instructions.
16
- */
17
-
18
- /*
19
- * Cross-browser event and position routines
20
- */
21
-
22
- function getPointerEvent(e) {
23
- return e.changedTouches ? e.changedTouches[0] : e.touches ? e.touches[0] : e;
24
- }
25
- function stopEvent(e) {
26
- e.stopPropagation();
27
- e.preventDefault();
28
- }
29
-
30
- // Emulate Element.setCapture() when not supported
31
- var _captureRecursion = false;
32
- var _elementForUnflushedEvents = null;
33
- document.captureElement = null;
34
- function _captureProxy(e) {
35
- // Recursion protection as we'll see our own event
36
- if (_captureRecursion) return;
37
-
38
- // Clone the event as we cannot dispatch an already dispatched event
39
- var newEv = new e.constructor(e.type, e);
40
- _captureRecursion = true;
41
- if (document.captureElement) {
42
- document.captureElement.dispatchEvent(newEv);
43
- } else {
44
- _elementForUnflushedEvents.dispatchEvent(newEv);
45
- }
46
- _captureRecursion = false;
47
-
48
- // Avoid double events
49
- e.stopPropagation();
50
-
51
- // Respect the wishes of the redirected event handlers
52
- if (newEv.defaultPrevented) {
53
- e.preventDefault();
54
- }
55
-
56
- // Implicitly release the capture on button release
57
- if (e.type === "mouseup") {
58
- releaseCapture();
59
- }
60
- }
61
-
62
- // Follow cursor style of target element
63
- function _capturedElemChanged() {
64
- var proxyElem = document.getElementById("noVNC_mouse_capture_elem");
65
- proxyElem.style.cursor = window.getComputedStyle(document.captureElement).cursor;
66
- }
67
- var _captureObserver = new MutationObserver(_capturedElemChanged);
68
- function setCapture(target) {
69
- if (target.setCapture) {
70
- target.setCapture();
71
- document.captureElement = target;
72
- } else {
73
- // Release any existing capture in case this method is
74
- // called multiple times without coordination
75
- releaseCapture();
76
- var proxyElem = document.getElementById("noVNC_mouse_capture_elem");
77
- if (proxyElem === null) {
78
- proxyElem = document.createElement("div");
79
- proxyElem.id = "noVNC_mouse_capture_elem";
80
- proxyElem.style.position = "fixed";
81
- proxyElem.style.top = "0px";
82
- proxyElem.style.left = "0px";
83
- proxyElem.style.width = "100%";
84
- proxyElem.style.height = "100%";
85
- proxyElem.style.zIndex = 10000;
86
- proxyElem.style.display = "none";
87
- document.body.appendChild(proxyElem);
88
-
89
- // This is to make sure callers don't get confused by having
90
- // our blocking element as the target
91
- proxyElem.addEventListener('contextmenu', _captureProxy);
92
- proxyElem.addEventListener('mousemove', _captureProxy);
93
- proxyElem.addEventListener('mouseup', _captureProxy);
94
- }
95
- document.captureElement = target;
96
-
97
- // Track cursor and get initial cursor
98
- _captureObserver.observe(target, {
99
- attributes: true
100
- });
101
- _capturedElemChanged();
102
- proxyElem.style.display = "";
103
-
104
- // We listen to events on window in order to keep tracking if it
105
- // happens to leave the viewport
106
- window.addEventListener('mousemove', _captureProxy);
107
- window.addEventListener('mouseup', _captureProxy);
108
- }
109
- }
110
- function releaseCapture() {
111
- if (document.releaseCapture) {
112
- document.releaseCapture();
113
- document.captureElement = null;
114
- } else {
115
- if (!document.captureElement) {
116
- return;
117
- }
118
-
119
- // There might be events already queued. The event proxy needs
120
- // access to the captured element for these queued events.
121
- // E.g. contextmenu (right-click) in Microsoft Edge
122
- //
123
- // Before removing the capturedElem pointer we save it to a
124
- // temporary variable that the unflushed events can use.
125
- _elementForUnflushedEvents = document.captureElement;
126
- document.captureElement = null;
127
- _captureObserver.disconnect();
128
- var proxyElem = document.getElementById("noVNC_mouse_capture_elem");
129
- proxyElem.style.display = "none";
130
- window.removeEventListener('mousemove', _captureProxy);
131
- window.removeEventListener('mouseup', _captureProxy);
132
- }
133
- }
@@ -1,53 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
- 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); }
8
- function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
9
- 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); } }
10
- function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
11
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
12
- 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); }
13
- /*
14
- * noVNC: HTML5 VNC client
15
- * Copyright (C) 2019 The noVNC authors
16
- * Licensed under MPL 2.0 (see LICENSE.txt)
17
- *
18
- * See README.md for usage and integration instructions.
19
- */
20
- var EventTargetMixin = exports["default"] = /*#__PURE__*/function () {
21
- function EventTargetMixin() {
22
- _classCallCheck(this, EventTargetMixin);
23
- this._listeners = new Map();
24
- }
25
- return _createClass(EventTargetMixin, [{
26
- key: "addEventListener",
27
- value: function addEventListener(type, callback) {
28
- if (!this._listeners.has(type)) {
29
- this._listeners.set(type, new Set());
30
- }
31
- this._listeners.get(type).add(callback);
32
- }
33
- }, {
34
- key: "removeEventListener",
35
- value: function removeEventListener(type, callback) {
36
- if (this._listeners.has(type)) {
37
- this._listeners.get(type)["delete"](callback);
38
- }
39
- }
40
- }, {
41
- key: "dispatchEvent",
42
- value: function dispatchEvent(event) {
43
- var _this = this;
44
- if (!this._listeners.has(event.type)) {
45
- return true;
46
- }
47
- this._listeners.get(event.type).forEach(function (callback) {
48
- return callback.call(_this, event);
49
- });
50
- return !event.defaultPrevented;
51
- }
52
- }]);
53
- }();
package/lib/util/int.js DELETED
@@ -1,21 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.toSigned32bit = toSigned32bit;
7
- exports.toUnsigned32bit = toUnsigned32bit;
8
- /*
9
- * noVNC: HTML5 VNC client
10
- * Copyright (C) 2020 The noVNC authors
11
- * Licensed under MPL 2.0 (see LICENSE.txt)
12
- *
13
- * See README.md for usage and integration instructions.
14
- */
15
-
16
- function toUnsigned32bit(toConvert) {
17
- return toConvert >>> 0;
18
- }
19
- function toSigned32bit(toConvert) {
20
- return toConvert | 0;
21
- }
@@ -1,56 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Warn = exports.Info = exports.Error = exports.Debug = void 0;
7
- exports.getLogging = getLogging;
8
- exports.initLogging = initLogging;
9
- /*
10
- * noVNC: HTML5 VNC client
11
- * Copyright (C) 2019 The noVNC authors
12
- * Licensed under MPL 2.0 (see LICENSE.txt)
13
- *
14
- * See README.md for usage and integration instructions.
15
- */
16
-
17
- /*
18
- * Logging/debug routines
19
- */
20
-
21
- var _logLevel = 'warn';
22
- var Debug = exports.Debug = function Debug() {};
23
- var Info = exports.Info = function Info() {};
24
- var Warn = exports.Warn = function Warn() {};
25
- var Error = exports.Error = function Error() {};
26
- function initLogging(level) {
27
- if (typeof level === 'undefined') {
28
- level = _logLevel;
29
- } else {
30
- _logLevel = level;
31
- }
32
- exports.Debug = Debug = exports.Info = Info = exports.Warn = Warn = exports.Error = Error = function Error() {};
33
- if (typeof window.console !== "undefined") {
34
- /* eslint-disable no-console, no-fallthrough */
35
- switch (level) {
36
- case 'debug':
37
- exports.Debug = Debug = console.debug.bind(window.console);
38
- case 'info':
39
- exports.Info = Info = console.info.bind(window.console);
40
- case 'warn':
41
- exports.Warn = Warn = console.warn.bind(window.console);
42
- case 'error':
43
- exports.Error = Error = console.error.bind(window.console);
44
- case 'none':
45
- break;
46
- default:
47
- throw new window.Error("invalid logging type '" + level + "'");
48
- }
49
- /* eslint-enable no-console, no-fallthrough */
50
- }
51
- }
52
- function getLogging() {
53
- return _logLevel;
54
- }
55
- // Initialize logging level
56
- initLogging();
@@ -1,36 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.decodeUTF8 = decodeUTF8;
7
- exports.encodeUTF8 = encodeUTF8;
8
- /*
9
- * noVNC: HTML5 VNC client
10
- * Copyright (C) 2019 The noVNC authors
11
- * Licensed under MPL 2.0 (see LICENSE.txt)
12
- *
13
- * See README.md for usage and integration instructions.
14
- */
15
-
16
- // Decode from UTF-8
17
- function decodeUTF8(utf8string) {
18
- var allowLatin1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
19
- try {
20
- return decodeURIComponent(escape(utf8string));
21
- } catch (e) {
22
- if (e instanceof URIError) {
23
- if (allowLatin1) {
24
- // If we allow Latin1 we can ignore any decoding fails
25
- // and in these cases return the original string
26
- return utf8string;
27
- }
28
- }
29
- throw e;
30
- }
31
- }
32
-
33
- // Encode to UTF-8
34
- function encodeUTF8(DOMString) {
35
- return unescape(encodeURIComponent(DOMString));
36
- }
@@ -1,47 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
- var _default = exports["default"] = {
8
- /* Allowed flush values; see deflate() and inflate() below for details */
9
- Z_NO_FLUSH: 0,
10
- Z_PARTIAL_FLUSH: 1,
11
- Z_SYNC_FLUSH: 2,
12
- Z_FULL_FLUSH: 3,
13
- Z_FINISH: 4,
14
- Z_BLOCK: 5,
15
- Z_TREES: 6,
16
- /* Return codes for the compression/decompression functions. Negative values
17
- * are errors, positive values are used for special but normal events.
18
- */
19
- Z_OK: 0,
20
- Z_STREAM_END: 1,
21
- Z_NEED_DICT: 2,
22
- Z_ERRNO: -1,
23
- Z_STREAM_ERROR: -2,
24
- Z_DATA_ERROR: -3,
25
- //Z_MEM_ERROR: -4,
26
- Z_BUF_ERROR: -5,
27
- //Z_VERSION_ERROR: -6,
28
-
29
- /* compression levels */
30
- Z_NO_COMPRESSION: 0,
31
- Z_BEST_SPEED: 1,
32
- Z_BEST_COMPRESSION: 9,
33
- Z_DEFAULT_COMPRESSION: -1,
34
- Z_FILTERED: 1,
35
- Z_HUFFMAN_ONLY: 2,
36
- Z_RLE: 3,
37
- Z_FIXED: 4,
38
- Z_DEFAULT_STRATEGY: 0,
39
- /* Possible values of the data_type field (though see inflate()) */
40
- Z_BINARY: 0,
41
- Z_TEXT: 1,
42
- //Z_ASCII: 1, // = Z_TEXT (deprecated)
43
- Z_UNKNOWN: 2,
44
- /* The deflate compression method */
45
- Z_DEFLATED: 8
46
- //Z_NULL: null // Use -1 or null inline, depending on var type
47
- };