@novnc/novnc 1.2.0-test → 1.3.0-g7ad4e60

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 (63) hide show
  1. package/LICENSE.txt +0 -6
  2. package/README.md +4 -4
  3. package/core/decoders/copyrect.js +5 -0
  4. package/core/decoders/hextile.js +57 -3
  5. package/core/decoders/raw.js +12 -2
  6. package/core/decoders/tight.js +24 -8
  7. package/core/display.js +9 -151
  8. package/core/input/domkeytable.js +25 -21
  9. package/core/input/keyboard.js +12 -127
  10. package/core/input/util.js +18 -35
  11. package/core/input/vkeys.js +0 -1
  12. package/core/input/xtscancodes.js +5 -3
  13. package/core/rfb.js +116 -109
  14. package/core/util/browser.js +0 -17
  15. package/core/util/cursor.js +1 -11
  16. package/core/util/events.js +0 -4
  17. package/core/websock.js +76 -17
  18. package/docs/API.md +10 -3
  19. package/docs/LIBRARY.md +3 -7
  20. package/lib/base64.js +4 -4
  21. package/lib/decoders/copyrect.js +7 -2
  22. package/lib/decoders/hextile.js +63 -7
  23. package/lib/decoders/raw.js +13 -4
  24. package/lib/decoders/rre.js +2 -2
  25. package/lib/decoders/tight.js +38 -20
  26. package/lib/decoders/tightpng.js +8 -8
  27. package/lib/deflator.js +4 -4
  28. package/lib/des.js +2 -2
  29. package/lib/display.js +45 -212
  30. package/lib/inflator.js +4 -4
  31. package/lib/input/domkeytable.js +197 -194
  32. package/lib/input/fixedkeys.js +2 -2
  33. package/lib/input/gesturehandler.js +2 -2
  34. package/lib/input/keyboard.js +38 -158
  35. package/lib/input/keysym.js +2 -2
  36. package/lib/input/keysymdef.js +2 -2
  37. package/lib/input/util.js +34 -79
  38. package/lib/input/vkeys.js +2 -4
  39. package/lib/input/xtscancodes.js +11 -5
  40. package/lib/rfb.js +292 -286
  41. package/lib/util/browser.js +8 -26
  42. package/lib/util/cursor.js +4 -16
  43. package/lib/util/events.js +3 -5
  44. package/lib/util/eventtarget.js +3 -3
  45. package/lib/util/int.js +1 -1
  46. package/lib/util/logging.js +2 -2
  47. package/lib/vendor/pako/lib/utils/common.js +2 -2
  48. package/lib/vendor/pako/lib/zlib/adler32.js +1 -1
  49. package/lib/vendor/pako/lib/zlib/constants.js +2 -2
  50. package/lib/vendor/pako/lib/zlib/crc32.js +1 -1
  51. package/lib/vendor/pako/lib/zlib/deflate.js +113 -112
  52. package/lib/vendor/pako/lib/zlib/gzheader.js +1 -1
  53. package/lib/vendor/pako/lib/zlib/inffast.js +5 -5
  54. package/lib/vendor/pako/lib/zlib/inflate.js +50 -48
  55. package/lib/vendor/pako/lib/zlib/inftrees.js +3 -3
  56. package/lib/vendor/pako/lib/zlib/messages.js +2 -2
  57. package/lib/vendor/pako/lib/zlib/trees.js +4 -4
  58. package/lib/vendor/pako/lib/zlib/zstream.js +1 -1
  59. package/lib/websock.js +105 -44
  60. package/package.json +2 -7
  61. package/core/util/polyfill.js +0 -61
  62. package/lib/util/polyfill.js +0 -72
  63. package/lib/vendor/promise.js +0 -255
@@ -1,61 +0,0 @@
1
- /*
2
- * noVNC: HTML5 VNC client
3
- * Copyright (C) 2020 The noVNC Authors
4
- * Licensed under MPL 2.0 or any later version (see LICENSE.txt)
5
- */
6
-
7
- /* Polyfills to provide new APIs in old browsers */
8
-
9
- /* Object.assign() (taken from MDN) */
10
- if (typeof Object.assign != 'function') {
11
- // Must be writable: true, enumerable: false, configurable: true
12
- Object.defineProperty(Object, "assign", {
13
- value: function assign(target, varArgs) { // .length of function is 2
14
- 'use strict';
15
- if (target == null) { // TypeError if undefined or null
16
- throw new TypeError('Cannot convert undefined or null to object');
17
- }
18
-
19
- const to = Object(target);
20
-
21
- for (let index = 1; index < arguments.length; index++) {
22
- const nextSource = arguments[index];
23
-
24
- if (nextSource != null) { // Skip over if undefined or null
25
- for (let nextKey in nextSource) {
26
- // Avoid bugs when hasOwnProperty is shadowed
27
- if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
28
- to[nextKey] = nextSource[nextKey];
29
- }
30
- }
31
- }
32
- }
33
- return to;
34
- },
35
- writable: true,
36
- configurable: true
37
- });
38
- }
39
-
40
- /* CustomEvent constructor (taken from MDN) */
41
- (() => {
42
- function CustomEvent(event, params) {
43
- params = params || { bubbles: false, cancelable: false, detail: undefined };
44
- const evt = document.createEvent( 'CustomEvent' );
45
- evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail );
46
- return evt;
47
- }
48
-
49
- CustomEvent.prototype = window.Event.prototype;
50
-
51
- if (typeof window.CustomEvent !== "function") {
52
- window.CustomEvent = CustomEvent;
53
- }
54
- })();
55
-
56
- /* Number.isInteger() (taken from MDN) */
57
- Number.isInteger = Number.isInteger || function isInteger(value) {
58
- return typeof value === 'number' &&
59
- isFinite(value) &&
60
- Math.floor(value) === value;
61
- };
@@ -1,72 +0,0 @@
1
- "use strict";
2
-
3
- /*
4
- * noVNC: HTML5 VNC client
5
- * Copyright (C) 2020 The noVNC Authors
6
- * Licensed under MPL 2.0 or any later version (see LICENSE.txt)
7
- */
8
-
9
- /* Polyfills to provide new APIs in old browsers */
10
-
11
- /* Object.assign() (taken from MDN) */
12
- if (typeof Object.assign != 'function') {
13
- // Must be writable: true, enumerable: false, configurable: true
14
- Object.defineProperty(Object, "assign", {
15
- value: function assign(target, varArgs) {
16
- // .length of function is 2
17
- 'use strict';
18
-
19
- if (target == null) {
20
- // TypeError if undefined or null
21
- throw new TypeError('Cannot convert undefined or null to object');
22
- }
23
-
24
- var to = Object(target);
25
-
26
- for (var index = 1; index < arguments.length; index++) {
27
- var nextSource = arguments[index];
28
-
29
- if (nextSource != null) {
30
- // Skip over if undefined or null
31
- for (var nextKey in nextSource) {
32
- // Avoid bugs when hasOwnProperty is shadowed
33
- if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
34
- to[nextKey] = nextSource[nextKey];
35
- }
36
- }
37
- }
38
- }
39
-
40
- return to;
41
- },
42
- writable: true,
43
- configurable: true
44
- });
45
- }
46
- /* CustomEvent constructor (taken from MDN) */
47
-
48
-
49
- (function () {
50
- function CustomEvent(event, params) {
51
- params = params || {
52
- bubbles: false,
53
- cancelable: false,
54
- detail: undefined
55
- };
56
- var evt = document.createEvent('CustomEvent');
57
- evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
58
- return evt;
59
- }
60
-
61
- CustomEvent.prototype = window.Event.prototype;
62
-
63
- if (typeof window.CustomEvent !== "function") {
64
- window.CustomEvent = CustomEvent;
65
- }
66
- })();
67
- /* Number.isInteger() (taken from MDN) */
68
-
69
-
70
- Number.isInteger = Number.isInteger || function isInteger(value) {
71
- return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;
72
- };
@@ -1,255 +0,0 @@
1
- /* Copyright (c) 2014 Taylor Hakes
2
- * Copyright (c) 2014 Forbes Lindesay
3
- *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal
6
- * in the Software without restriction, including without limitation the rights
7
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- * copies of the Software, and to permit persons to whom the Software is
9
- * furnished to do so, subject to the following conditions:
10
- *
11
- * The above copyright notice and this permission notice shall be included in
12
- * all copies or substantial portions of the Software.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
- * THE SOFTWARE.
21
- */
22
-
23
- (function (root) {
24
-
25
- // Store setTimeout reference so promise-polyfill will be unaffected by
26
- // other code modifying setTimeout (like sinon.useFakeTimers())
27
- var setTimeoutFunc = setTimeout;
28
-
29
- function noop() {}
30
-
31
- // Polyfill for Function.prototype.bind
32
- function bind(fn, thisArg) {
33
- return function () {
34
- fn.apply(thisArg, arguments);
35
- };
36
- }
37
-
38
- function Promise(fn) {
39
- if (typeof this !== 'object') throw new TypeError('Promises must be constructed via new');
40
- if (typeof fn !== 'function') throw new TypeError('not a function');
41
- this._state = 0;
42
- this._handled = false;
43
- this._value = undefined;
44
- this._deferreds = [];
45
-
46
- doResolve(fn, this);
47
- }
48
-
49
- function handle(self, deferred) {
50
- while (self._state === 3) {
51
- self = self._value;
52
- }
53
- if (self._state === 0) {
54
- self._deferreds.push(deferred);
55
- return;
56
- }
57
- self._handled = true;
58
- Promise._immediateFn(function () {
59
- var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;
60
- if (cb === null) {
61
- (self._state === 1 ? resolve : reject)(deferred.promise, self._value);
62
- return;
63
- }
64
- var ret;
65
- try {
66
- ret = cb(self._value);
67
- } catch (e) {
68
- reject(deferred.promise, e);
69
- return;
70
- }
71
- resolve(deferred.promise, ret);
72
- });
73
- }
74
-
75
- function resolve(self, newValue) {
76
- try {
77
- // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure
78
- if (newValue === self) throw new TypeError('A promise cannot be resolved with itself.');
79
- if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) {
80
- var then = newValue.then;
81
- if (newValue instanceof Promise) {
82
- self._state = 3;
83
- self._value = newValue;
84
- finale(self);
85
- return;
86
- } else if (typeof then === 'function') {
87
- doResolve(bind(then, newValue), self);
88
- return;
89
- }
90
- }
91
- self._state = 1;
92
- self._value = newValue;
93
- finale(self);
94
- } catch (e) {
95
- reject(self, e);
96
- }
97
- }
98
-
99
- function reject(self, newValue) {
100
- self._state = 2;
101
- self._value = newValue;
102
- finale(self);
103
- }
104
-
105
- function finale(self) {
106
- if (self._state === 2 && self._deferreds.length === 0) {
107
- Promise._immediateFn(function() {
108
- if (!self._handled) {
109
- Promise._unhandledRejectionFn(self._value);
110
- }
111
- });
112
- }
113
-
114
- for (var i = 0, len = self._deferreds.length; i < len; i++) {
115
- handle(self, self._deferreds[i]);
116
- }
117
- self._deferreds = null;
118
- }
119
-
120
- function Handler(onFulfilled, onRejected, promise) {
121
- this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
122
- this.onRejected = typeof onRejected === 'function' ? onRejected : null;
123
- this.promise = promise;
124
- }
125
-
126
- /**
127
- * Take a potentially misbehaving resolver function and make sure
128
- * onFulfilled and onRejected are only called once.
129
- *
130
- * Makes no guarantees about asynchrony.
131
- */
132
- function doResolve(fn, self) {
133
- var done = false;
134
- try {
135
- fn(function (value) {
136
- if (done) return;
137
- done = true;
138
- resolve(self, value);
139
- }, function (reason) {
140
- if (done) return;
141
- done = true;
142
- reject(self, reason);
143
- });
144
- } catch (ex) {
145
- if (done) return;
146
- done = true;
147
- reject(self, ex);
148
- }
149
- }
150
-
151
- Promise.prototype['catch'] = function (onRejected) {
152
- return this.then(null, onRejected);
153
- };
154
-
155
- Promise.prototype.then = function (onFulfilled, onRejected) {
156
- var prom = new (this.constructor)(noop);
157
-
158
- handle(this, new Handler(onFulfilled, onRejected, prom));
159
- return prom;
160
- };
161
-
162
- Promise.all = function (arr) {
163
- var args = Array.prototype.slice.call(arr);
164
-
165
- return new Promise(function (resolve, reject) {
166
- if (args.length === 0) return resolve([]);
167
- var remaining = args.length;
168
-
169
- function res(i, val) {
170
- try {
171
- if (val && (typeof val === 'object' || typeof val === 'function')) {
172
- var then = val.then;
173
- if (typeof then === 'function') {
174
- then.call(val, function (val) {
175
- res(i, val);
176
- }, reject);
177
- return;
178
- }
179
- }
180
- args[i] = val;
181
- if (--remaining === 0) {
182
- resolve(args);
183
- }
184
- } catch (ex) {
185
- reject(ex);
186
- }
187
- }
188
-
189
- for (var i = 0; i < args.length; i++) {
190
- res(i, args[i]);
191
- }
192
- });
193
- };
194
-
195
- Promise.resolve = function (value) {
196
- if (value && typeof value === 'object' && value.constructor === Promise) {
197
- return value;
198
- }
199
-
200
- return new Promise(function (resolve) {
201
- resolve(value);
202
- });
203
- };
204
-
205
- Promise.reject = function (value) {
206
- return new Promise(function (resolve, reject) {
207
- reject(value);
208
- });
209
- };
210
-
211
- Promise.race = function (values) {
212
- return new Promise(function (resolve, reject) {
213
- for (var i = 0, len = values.length; i < len; i++) {
214
- values[i].then(resolve, reject);
215
- }
216
- });
217
- };
218
-
219
- // Use polyfill for setImmediate for performance gains
220
- Promise._immediateFn = (typeof setImmediate === 'function' && function (fn) { setImmediate(fn); }) ||
221
- function (fn) {
222
- setTimeoutFunc(fn, 0);
223
- };
224
-
225
- Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) {
226
- if (typeof console !== 'undefined' && console) {
227
- console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console
228
- }
229
- };
230
-
231
- /**
232
- * Set the immediate function to execute callbacks
233
- * @param fn {function} Function to execute
234
- * @deprecated
235
- */
236
- Promise._setImmediateFn = function _setImmediateFn(fn) {
237
- Promise._immediateFn = fn;
238
- };
239
-
240
- /**
241
- * Change the function to execute on unhandled rejection
242
- * @param {function} fn Function to execute on unhandled rejection
243
- * @deprecated
244
- */
245
- Promise._setUnhandledRejectionFn = function _setUnhandledRejectionFn(fn) {
246
- Promise._unhandledRejectionFn = fn;
247
- };
248
-
249
- if (typeof module !== 'undefined' && module.exports) {
250
- module.exports = Promise;
251
- } else if (!root.Promise) {
252
- root.Promise = Promise;
253
- }
254
-
255
- })(this);