@novnc/novnc 1.0.0 → 1.2.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.
- package/AUTHORS +13 -0
- package/LICENSE.txt +2 -1
- package/README.md +69 -3
- package/core/base64.js +35 -41
- package/core/decoders/copyrect.js +22 -0
- package/core/decoders/hextile.js +137 -0
- package/core/decoders/raw.js +56 -0
- package/core/decoders/rre.js +44 -0
- package/core/decoders/tight.js +315 -0
- package/core/decoders/tightpng.js +27 -0
- package/core/deflator.js +85 -0
- package/core/des.js +90 -95
- package/core/display.js +254 -297
- package/core/encodings.js +7 -3
- package/core/inflator.js +48 -20
- package/core/input/domkeytable.js +21 -24
- package/core/input/fixedkeys.js +3 -1
- package/core/input/gesturehandler.js +567 -0
- package/core/input/keyboard.js +194 -120
- package/core/input/keysym.js +2 -0
- package/core/input/keysymdef.js +3 -3
- package/core/input/util.js +53 -12
- package/core/input/vkeys.js +2 -1
- package/core/rfb.js +1937 -1496
- package/core/util/browser.js +80 -29
- package/core/util/cursor.js +253 -0
- package/core/util/element.js +32 -0
- package/core/util/events.js +59 -55
- package/core/util/eventtarget.js +25 -30
- package/core/util/int.js +15 -0
- package/core/util/logging.js +21 -16
- package/core/util/polyfill.js +15 -8
- package/core/util/strings.js +21 -8
- package/core/websock.js +145 -167
- package/docs/API.md +31 -10
- package/lib/base64.js +115 -0
- package/lib/decoders/copyrect.js +44 -0
- package/lib/decoders/hextile.js +173 -0
- package/lib/decoders/raw.js +78 -0
- package/lib/decoders/rre.js +65 -0
- package/lib/decoders/tight.js +350 -0
- package/lib/decoders/tightpng.js +67 -0
- package/lib/deflator.js +99 -0
- package/lib/des.js +314 -0
- package/lib/display.js +733 -0
- package/lib/encodings.js +64 -0
- package/lib/inflator.js +87 -0
- package/lib/input/domkeytable.js +282 -0
- package/lib/input/fixedkeys.js +123 -0
- package/lib/input/gesturehandler.js +642 -0
- package/lib/input/keyboard.js +429 -0
- package/lib/input/keysym.js +1135 -0
- package/lib/input/keysymdef.js +1354 -0
- package/lib/input/util.js +304 -0
- package/lib/input/vkeys.js +127 -0
- package/lib/input/xtscancodes.js +505 -0
- package/lib/rfb.js +3448 -0
- package/lib/util/browser.js +131 -0
- package/lib/util/cursor.js +314 -0
- package/lib/util/element.js +43 -0
- package/lib/util/events.js +142 -0
- package/lib/util/eventtarget.js +64 -0
- package/lib/util/int.js +22 -0
- package/lib/util/logging.js +79 -0
- package/lib/util/polyfill.js +72 -0
- package/lib/util/strings.js +38 -0
- package/lib/vendor/pako/lib/utils/common.js +67 -0
- package/lib/vendor/pako/lib/zlib/adler32.js +33 -0
- package/lib/vendor/pako/lib/zlib/constants.js +51 -0
- package/lib/vendor/pako/lib/zlib/crc32.js +42 -0
- package/lib/vendor/pako/lib/zlib/deflate.js +2159 -0
- package/lib/vendor/pako/lib/zlib/gzheader.js +53 -0
- package/lib/vendor/pako/lib/zlib/inffast.js +445 -0
- package/lib/vendor/pako/lib/zlib/inflate.js +2114 -0
- package/lib/vendor/pako/lib/zlib/inftrees.js +418 -0
- package/lib/vendor/pako/lib/zlib/messages.js +36 -0
- package/lib/vendor/pako/lib/zlib/trees.js +1499 -0
- package/lib/vendor/pako/lib/zlib/zstream.js +46 -0
- package/lib/vendor/promise.js +255 -0
- package/lib/websock.js +374 -0
- package/package.json +48 -28
- package/vendor/pako/lib/zlib/deflate.js +30 -30
- package/vendor/pako/lib/zlib/inflate.js +17 -17
- package/core/input/mouse.js +0 -280
- package/docs/API-internal.md +0 -125
- package/docs/EMBEDDING.md +0 -83
- package/docs/VERSION +0 -1
package/core/encodings.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* noVNC: HTML5 VNC client
|
|
3
|
-
* Copyright (C)
|
|
3
|
+
* Copyright (C) 2019 The noVNC Authors
|
|
4
4
|
* Licensed under MPL 2.0 (see LICENSE.txt)
|
|
5
5
|
*
|
|
6
6
|
* See README.md for usage and integration instructions.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
export
|
|
9
|
+
export const encodings = {
|
|
10
10
|
encodingRaw: 0,
|
|
11
11
|
encodingCopyRect: 1,
|
|
12
12
|
encodingRRE: 2,
|
|
13
13
|
encodingHextile: 5,
|
|
14
14
|
encodingTight: 7,
|
|
15
|
+
encodingTightPNG: -260,
|
|
15
16
|
|
|
16
17
|
pseudoEncodingQualityLevel9: -23,
|
|
17
18
|
pseudoEncodingQualityLevel0: -32,
|
|
@@ -19,13 +20,15 @@ export var encodings = {
|
|
|
19
20
|
pseudoEncodingLastRect: -224,
|
|
20
21
|
pseudoEncodingCursor: -239,
|
|
21
22
|
pseudoEncodingQEMUExtendedKeyEvent: -258,
|
|
22
|
-
|
|
23
|
+
pseudoEncodingDesktopName: -307,
|
|
23
24
|
pseudoEncodingExtendedDesktopSize: -308,
|
|
24
25
|
pseudoEncodingXvp: -309,
|
|
25
26
|
pseudoEncodingFence: -312,
|
|
26
27
|
pseudoEncodingContinuousUpdates: -313,
|
|
27
28
|
pseudoEncodingCompressLevel9: -247,
|
|
28
29
|
pseudoEncodingCompressLevel0: -256,
|
|
30
|
+
pseudoEncodingVMwareCursor: 0x574d5664,
|
|
31
|
+
pseudoEncodingExtendedClipboard: 0xc0a1e5ce
|
|
29
32
|
};
|
|
30
33
|
|
|
31
34
|
export function encodingName(num) {
|
|
@@ -35,6 +38,7 @@ export function encodingName(num) {
|
|
|
35
38
|
case encodings.encodingRRE: return "RRE";
|
|
36
39
|
case encodings.encodingHextile: return "Hextile";
|
|
37
40
|
case encodings.encodingTight: return "Tight";
|
|
41
|
+
case encodings.encodingTightPNG: return "TightPNG";
|
|
38
42
|
default: return "[unknown encoding " + num + "]";
|
|
39
43
|
}
|
|
40
44
|
}
|
package/core/inflator.js
CHANGED
|
@@ -1,13 +1,40 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* noVNC: HTML5 VNC client
|
|
3
|
+
* Copyright (C) 2020 The noVNC Authors
|
|
4
|
+
* Licensed under MPL 2.0 (see LICENSE.txt)
|
|
5
|
+
*
|
|
6
|
+
* See README.md for usage and integration instructions.
|
|
7
|
+
*/
|
|
8
|
+
|
|
1
9
|
import { inflateInit, inflate, inflateReset } from "../vendor/pako/lib/zlib/inflate.js";
|
|
2
10
|
import ZStream from "../vendor/pako/lib/zlib/zstream.js";
|
|
3
11
|
|
|
4
|
-
Inflate
|
|
5
|
-
|
|
6
|
-
this.strm
|
|
7
|
-
this.
|
|
8
|
-
this.strm.
|
|
9
|
-
this.
|
|
12
|
+
export default class Inflate {
|
|
13
|
+
constructor() {
|
|
14
|
+
this.strm = new ZStream();
|
|
15
|
+
this.chunkSize = 1024 * 10 * 10;
|
|
16
|
+
this.strm.output = new Uint8Array(this.chunkSize);
|
|
17
|
+
this.windowBits = 5;
|
|
18
|
+
|
|
19
|
+
inflateInit(this.strm, this.windowBits);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
setInput(data) {
|
|
23
|
+
if (!data) {
|
|
24
|
+
//FIXME: flush remaining data.
|
|
25
|
+
/* eslint-disable camelcase */
|
|
26
|
+
this.strm.input = null;
|
|
27
|
+
this.strm.avail_in = 0;
|
|
28
|
+
this.strm.next_in = 0;
|
|
29
|
+
} else {
|
|
30
|
+
this.strm.input = data;
|
|
31
|
+
this.strm.avail_in = this.strm.input.length;
|
|
32
|
+
this.strm.next_in = 0;
|
|
33
|
+
/* eslint-enable camelcase */
|
|
34
|
+
}
|
|
35
|
+
}
|
|
10
36
|
|
|
37
|
+
inflate(expected) {
|
|
11
38
|
// resize our output buffer if it's too small
|
|
12
39
|
// (we could just use multiple chunks, but that would cause an extra
|
|
13
40
|
// allocation each time to flatten the chunks)
|
|
@@ -16,23 +43,24 @@ Inflate.prototype = {
|
|
|
16
43
|
this.strm.output = new Uint8Array(this.chunkSize);
|
|
17
44
|
}
|
|
18
45
|
|
|
19
|
-
|
|
46
|
+
/* eslint-disable camelcase */
|
|
47
|
+
this.strm.next_out = 0;
|
|
48
|
+
this.strm.avail_out = expected;
|
|
49
|
+
/* eslint-enable camelcase */
|
|
50
|
+
|
|
51
|
+
let ret = inflate(this.strm, 0); // Flush argument not used.
|
|
52
|
+
if (ret < 0) {
|
|
53
|
+
throw new Error("zlib inflate failed");
|
|
54
|
+
}
|
|
20
55
|
|
|
21
|
-
|
|
56
|
+
if (this.strm.next_out != expected) {
|
|
57
|
+
throw new Error("Incomplete zlib block");
|
|
58
|
+
}
|
|
22
59
|
|
|
23
60
|
return new Uint8Array(this.strm.output.buffer, 0, this.strm.next_out);
|
|
24
|
-
}
|
|
61
|
+
}
|
|
25
62
|
|
|
26
|
-
reset
|
|
63
|
+
reset() {
|
|
27
64
|
inflateReset(this.strm);
|
|
28
65
|
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export default function Inflate() {
|
|
32
|
-
this.strm = new ZStream();
|
|
33
|
-
this.chunkSize = 1024 * 10 * 10;
|
|
34
|
-
this.strm.output = new Uint8Array(this.chunkSize);
|
|
35
|
-
this.windowBits = 5;
|
|
36
|
-
|
|
37
|
-
inflateInit(this.strm, this.windowBits);
|
|
38
|
-
};
|
|
66
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* noVNC: HTML5 VNC client
|
|
3
|
-
* Copyright (C)
|
|
3
|
+
* Copyright (C) 2018 The noVNC Authors
|
|
4
4
|
* Licensed under MPL 2.0 or any later version (see LICENSE.txt)
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -13,28 +13,25 @@ import KeyTable from "./keysym.js";
|
|
|
13
13
|
* See https://www.w3.org/TR/uievents-key/ for possible values.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
const DOMKeyTable = {};
|
|
17
17
|
|
|
18
|
-
function addStandard(key, standard)
|
|
19
|
-
|
|
20
|
-
if (
|
|
21
|
-
if (key in DOMKeyTable) throw "Duplicate entry for key \"" + key + "\"";
|
|
18
|
+
function addStandard(key, standard) {
|
|
19
|
+
if (standard === undefined) throw new Error("Undefined keysym for key \"" + key + "\"");
|
|
20
|
+
if (key in DOMKeyTable) throw new Error("Duplicate entry for key \"" + key + "\"");
|
|
22
21
|
DOMKeyTable[key] = [standard, standard, standard, standard];
|
|
23
22
|
}
|
|
24
23
|
|
|
25
|
-
function addLeftRight(key, left, right)
|
|
26
|
-
|
|
27
|
-
if (
|
|
28
|
-
if (
|
|
29
|
-
if (key in DOMKeyTable) throw "Duplicate entry for key \"" + key + "\"";
|
|
24
|
+
function addLeftRight(key, left, right) {
|
|
25
|
+
if (left === undefined) throw new Error("Undefined keysym for key \"" + key + "\"");
|
|
26
|
+
if (right === undefined) throw new Error("Undefined keysym for key \"" + key + "\"");
|
|
27
|
+
if (key in DOMKeyTable) throw new Error("Duplicate entry for key \"" + key + "\"");
|
|
30
28
|
DOMKeyTable[key] = [left, left, right, left];
|
|
31
29
|
}
|
|
32
30
|
|
|
33
|
-
function addNumpad(key, standard, numpad)
|
|
34
|
-
|
|
35
|
-
if (
|
|
36
|
-
if (
|
|
37
|
-
if (key in DOMKeyTable) throw "Duplicate entry for key \"" + key + "\"";
|
|
31
|
+
function addNumpad(key, standard, numpad) {
|
|
32
|
+
if (standard === undefined) throw new Error("Undefined keysym for key \"" + key + "\"");
|
|
33
|
+
if (numpad === undefined) throw new Error("Undefined keysym for key \"" + key + "\"");
|
|
34
|
+
if (key in DOMKeyTable) throw new Error("Duplicate entry for key \"" + key + "\"");
|
|
38
35
|
DOMKeyTable[key] = [standard, standard, standard, numpad];
|
|
39
36
|
}
|
|
40
37
|
|
|
@@ -46,12 +43,10 @@ addStandard("CapsLock", KeyTable.XK_Caps_Lock);
|
|
|
46
43
|
addLeftRight("Control", KeyTable.XK_Control_L, KeyTable.XK_Control_R);
|
|
47
44
|
// - Fn
|
|
48
45
|
// - FnLock
|
|
49
|
-
addLeftRight("Hyper", KeyTable.XK_Super_L, KeyTable.XK_Super_R);
|
|
50
46
|
addLeftRight("Meta", KeyTable.XK_Super_L, KeyTable.XK_Super_R);
|
|
51
47
|
addStandard("NumLock", KeyTable.XK_Num_Lock);
|
|
52
48
|
addStandard("ScrollLock", KeyTable.XK_Scroll_Lock);
|
|
53
49
|
addLeftRight("Shift", KeyTable.XK_Shift_L, KeyTable.XK_Shift_R);
|
|
54
|
-
addLeftRight("Super", KeyTable.XK_Super_L, KeyTable.XK_Super_R);
|
|
55
50
|
// - Symbol
|
|
56
51
|
// - SymbolLock
|
|
57
52
|
|
|
@@ -75,7 +70,10 @@ addNumpad("PageUp", KeyTable.XK_Prior, KeyTable.XK_KP_Prior);
|
|
|
75
70
|
// 2.5. Editing Keys
|
|
76
71
|
|
|
77
72
|
addStandard("Backspace", KeyTable.XK_BackSpace);
|
|
78
|
-
|
|
73
|
+
// Browsers send "Clear" for the numpad 5 without NumLock because
|
|
74
|
+
// Windows uses VK_Clear for that key. But Unix expects KP_Begin for
|
|
75
|
+
// that scenario.
|
|
76
|
+
addNumpad("Clear", KeyTable.XK_Clear, KeyTable.XK_KP_Begin);
|
|
79
77
|
addStandard("Copy", KeyTable.XF86XK_Copy);
|
|
80
78
|
// - CrSel
|
|
81
79
|
addStandard("Cut", KeyTable.XF86XK_Cut);
|
|
@@ -197,7 +195,8 @@ addStandard("F35", KeyTable.XK_F35);
|
|
|
197
195
|
addStandard("Close", KeyTable.XF86XK_Close);
|
|
198
196
|
addStandard("MailForward", KeyTable.XF86XK_MailForward);
|
|
199
197
|
addStandard("MailReply", KeyTable.XF86XK_Reply);
|
|
200
|
-
addStandard("
|
|
198
|
+
addStandard("MailSend", KeyTable.XF86XK_Send);
|
|
199
|
+
// - MediaClose
|
|
201
200
|
addStandard("MediaFastForward", KeyTable.XF86XK_AudioForward);
|
|
202
201
|
addStandard("MediaPause", KeyTable.XF86XK_AudioPause);
|
|
203
202
|
addStandard("MediaPlay", KeyTable.XF86XK_AudioPlay);
|
|
@@ -221,11 +220,9 @@ addStandard("SpellCheck", KeyTable.XF86XK_Spell);
|
|
|
221
220
|
|
|
222
221
|
// - AudioBalanceLeft
|
|
223
222
|
// - AudioBalanceRight
|
|
224
|
-
// - AudioBassDown
|
|
225
223
|
// - AudioBassBoostDown
|
|
226
224
|
// - AudioBassBoostToggle
|
|
227
225
|
// - AudioBassBoostUp
|
|
228
|
-
// - AudioBassUp
|
|
229
226
|
// - AudioFaderFront
|
|
230
227
|
// - AudioFaderRear
|
|
231
228
|
// - AudioSurroundModeNext
|
|
@@ -246,12 +243,12 @@ addStandard("MicrophoneVolumeMute", KeyTable.XF86XK_AudioMicMute);
|
|
|
246
243
|
|
|
247
244
|
// 2.14. Application Keys
|
|
248
245
|
|
|
249
|
-
addStandard("
|
|
246
|
+
addStandard("LaunchApplication1", KeyTable.XF86XK_MyComputer);
|
|
247
|
+
addStandard("LaunchApplication2", KeyTable.XF86XK_Calculator);
|
|
250
248
|
addStandard("LaunchCalendar", KeyTable.XF86XK_Calendar);
|
|
251
249
|
addStandard("LaunchMail", KeyTable.XF86XK_Mail);
|
|
252
250
|
addStandard("LaunchMediaPlayer", KeyTable.XF86XK_AudioMedia);
|
|
253
251
|
addStandard("LaunchMusicPlayer", KeyTable.XF86XK_Music);
|
|
254
|
-
addStandard("LaunchMyComputer", KeyTable.XF86XK_MyComputer);
|
|
255
252
|
addStandard("LaunchPhone", KeyTable.XF86XK_Phone);
|
|
256
253
|
addStandard("LaunchScreenSaver", KeyTable.XF86XK_ScreenSaver);
|
|
257
254
|
addStandard("LaunchSpreadsheet", KeyTable.XF86XK_Excel);
|
package/core/input/fixedkeys.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* noVNC: HTML5 VNC client
|
|
3
|
-
* Copyright (C)
|
|
3
|
+
* Copyright (C) 2018 The noVNC Authors
|
|
4
4
|
* Licensed under MPL 2.0 or any later version (see LICENSE.txt)
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
* See https://www.w3.org/TR/uievents-key/ for possible values.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
/* eslint-disable key-spacing */
|
|
18
|
+
|
|
17
19
|
export default {
|
|
18
20
|
|
|
19
21
|
// 3.1.1.1. Writing System Keys
|