├── .gitmodules
├── defaults.json
├── mandatory.json
├── snap
├── hooks
│ └── configure
├── local
│ └── svc_wrapper.sh
└── snapcraft.yaml
├── app
├── sounds
│ ├── bell.mp3
│ ├── bell.oga
│ └── CREDITS
├── images
│ ├── icons
│ │ ├── novnc.ico
│ │ ├── novnc-ios-40.png
│ │ ├── novnc-ios-58.png
│ │ ├── novnc-ios-60.png
│ │ ├── novnc-ios-80.png
│ │ ├── novnc-ios-87.png
│ │ ├── novnc-ios-120.png
│ │ ├── novnc-ios-152.png
│ │ ├── novnc-ios-167.png
│ │ ├── novnc-ios-180.png
│ │ └── Makefile
│ ├── windows.svg
│ ├── handle.svg
│ ├── tab.svg
│ ├── expander.svg
│ ├── settings.svg
│ ├── error.svg
│ ├── fullscreen.svg
│ ├── info.svg
│ ├── ctrlaltdel.svg
│ ├── connect.svg
│ ├── alt.svg
│ ├── warning.svg
│ └── power.svg
├── styles
│ ├── Orbitron700.ttf
│ ├── Orbitron700.woff
│ └── constants.css
├── locale
│ ├── README
│ ├── zh_TW.json
│ ├── ko.json
│ ├── es.json
│ ├── tr.json
│ ├── it.json
│ ├── cs.json
│ ├── ru.json
│ ├── pt_BR.json
│ ├── ja.json
│ ├── zh_CN.json
│ ├── de.json
│ ├── pl.json
│ ├── sv.json
│ ├── hu.json
│ └── fr.json
└── error-handler.js
├── docs
├── rfbproto-3.3.pdf
├── rfbproto-3.7.pdf
├── rfbproto-3.8.pdf
├── notes
├── flash_policy.txt
├── LIBRARY.md
├── LICENSE.BSD-2-Clause
├── LICENSE.BSD-3-Clause
├── novnc_proxy.1
├── links
└── rfb_notes
├── .gitignore
├── .github
├── ISSUE_TEMPLATE
│ ├── config.yml
│ ├── feature_request.md
│ └── bug_report.md
└── workflows
│ ├── translate.yml
│ ├── lint.yml
│ ├── test.yml
│ └── deploy.yml
├── vendor
└── pako
│ ├── README.md
│ ├── lib
│ ├── zlib
│ │ ├── messages.js
│ │ ├── adler32.js
│ │ ├── crc32.js
│ │ ├── zstream.js
│ │ ├── gzheader.js
│ │ └── constants.js
│ └── utils
│ │ └── common.js
│ └── LICENSE
├── core
├── util
│ ├── int.js
│ ├── strings.js
│ ├── element.js
│ ├── eventtarget.js
│ └── logging.js
├── decoders
│ ├── copyrect.js
│ ├── tightpng.js
│ ├── rre.js
│ ├── zlib.js
│ └── raw.js
├── crypto
│ ├── bigint.js
│ ├── dh.js
│ └── crypto.js
├── encodings.js
├── inflator.js
├── clipboard.js
├── deflator.js
└── input
│ └── vkeys.js
├── AUTHORS
├── utils
├── b64-to-binary.pl
├── README.md
├── u2x11
├── validate
└── genkeysymdef.js
├── tests
├── test.int.js
├── vnc_playback.html
├── test.base64.js
├── test.deflator.js
├── test.zlib.js
├── fake.websocket.js
├── test.util.js
├── test.copyrect.js
├── test.inflator.js
└── test.clipboard.js
├── po
├── Makefile
├── po2js
└── xgettext-html
├── package.json
├── LICENSE.txt
├── karma.conf.cjs
└── eslint.config.mjs
/.gitmodules:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/defaults.json:
--------------------------------------------------------------------------------
1 | {}
2 |
--------------------------------------------------------------------------------
/mandatory.json:
--------------------------------------------------------------------------------
1 | {}
2 |
--------------------------------------------------------------------------------
/snap/hooks/configure:
--------------------------------------------------------------------------------
1 | #!/bin/sh -e
2 |
3 | snapctl restart novnc.novncsvc
4 |
--------------------------------------------------------------------------------
/app/sounds/bell.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/novnc/noVNC/HEAD/app/sounds/bell.mp3
--------------------------------------------------------------------------------
/app/sounds/bell.oga:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/novnc/noVNC/HEAD/app/sounds/bell.oga
--------------------------------------------------------------------------------
/docs/rfbproto-3.3.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/novnc/noVNC/HEAD/docs/rfbproto-3.3.pdf
--------------------------------------------------------------------------------
/docs/rfbproto-3.7.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/novnc/noVNC/HEAD/docs/rfbproto-3.7.pdf
--------------------------------------------------------------------------------
/docs/rfbproto-3.8.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/novnc/noVNC/HEAD/docs/rfbproto-3.8.pdf
--------------------------------------------------------------------------------
/app/images/icons/novnc.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/novnc/noVNC/HEAD/app/images/icons/novnc.ico
--------------------------------------------------------------------------------
/app/styles/Orbitron700.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/novnc/noVNC/HEAD/app/styles/Orbitron700.ttf
--------------------------------------------------------------------------------
/app/styles/Orbitron700.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/novnc/noVNC/HEAD/app/styles/Orbitron700.woff
--------------------------------------------------------------------------------
/app/images/icons/novnc-ios-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/novnc/noVNC/HEAD/app/images/icons/novnc-ios-40.png
--------------------------------------------------------------------------------
/app/images/icons/novnc-ios-58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/novnc/noVNC/HEAD/app/images/icons/novnc-ios-58.png
--------------------------------------------------------------------------------
/app/images/icons/novnc-ios-60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/novnc/noVNC/HEAD/app/images/icons/novnc-ios-60.png
--------------------------------------------------------------------------------
/app/images/icons/novnc-ios-80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/novnc/noVNC/HEAD/app/images/icons/novnc-ios-80.png
--------------------------------------------------------------------------------
/app/images/icons/novnc-ios-87.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/novnc/noVNC/HEAD/app/images/icons/novnc-ios-87.png
--------------------------------------------------------------------------------
/app/locale/README:
--------------------------------------------------------------------------------
1 | DO NOT MODIFY THE FILES IN THIS FOLDER, THEY ARE AUTOMATICALLY GENERATED FROM THE PO-FILES.
2 |
--------------------------------------------------------------------------------
/app/images/icons/novnc-ios-120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/novnc/noVNC/HEAD/app/images/icons/novnc-ios-120.png
--------------------------------------------------------------------------------
/app/images/icons/novnc-ios-152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/novnc/noVNC/HEAD/app/images/icons/novnc-ios-152.png
--------------------------------------------------------------------------------
/app/images/icons/novnc-ios-167.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/novnc/noVNC/HEAD/app/images/icons/novnc-ios-167.png
--------------------------------------------------------------------------------
/app/images/icons/novnc-ios-180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/novnc/noVNC/HEAD/app/images/icons/novnc-ios-180.png
--------------------------------------------------------------------------------
/docs/notes:
--------------------------------------------------------------------------------
1 | Rebuilding inflator.js
2 |
3 | - Download pako from npm
4 | - Install browserify using npm
5 | - browserify core/inflator.mod.js -o core/inflator.js -s Inflator
6 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.pyc
2 | *.o
3 | tests/data_*.js
4 | utils/rebind.so
5 | utils/websockify
6 | /node_modules
7 | /build
8 | /lib
9 | recordings
10 | *.swp
11 | *~
12 | noVNC-*.tgz
13 |
--------------------------------------------------------------------------------
/app/sounds/CREDITS:
--------------------------------------------------------------------------------
1 | bell
2 | Copyright: Dr. Richard Boulanger et al
3 | URL: http://www.archive.org/details/Berklee44v12
4 | License: CC-BY Attribution 3.0 Unported
5 |
--------------------------------------------------------------------------------
/docs/flash_policy.txt:
--------------------------------------------------------------------------------
1 | Manual setup:
2 |
3 | DATA="echo \'\'"
4 | /usr/bin/socat -T 1 TCP-L:843,reuseaddr,fork,crlf SYSTEM:"$DATA"
5 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: false
2 | contact_links:
3 | - name: Question or discussion
4 | url: https://groups.google.com/forum/?fromgroups#!forum/novnc
5 | about: Ask a question or start a discussion
6 |
--------------------------------------------------------------------------------
/vendor/pako/README.md:
--------------------------------------------------------------------------------
1 | This is an ES6-modules-compatible version of
2 | https://github.com/nodeca/pako, based on pako version 1.0.3.
3 |
4 | It's more-or-less a direct translation of the original, with unused parts
5 | removed, and the dynamic support for non-typed arrays removed (since ES6
6 | modules don't work well with dynamic exports).
7 |
--------------------------------------------------------------------------------
/core/util/int.js:
--------------------------------------------------------------------------------
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 |
9 | export function toUnsigned32bit(toConvert) {
10 | return toConvert >>> 0;
11 | }
12 |
13 | export function toSigned32bit(toConvert) {
14 | return toConvert | 0;
15 | }
16 |
--------------------------------------------------------------------------------
/AUTHORS:
--------------------------------------------------------------------------------
1 | maintainers:
2 | - Samuel Mannehed for Cendio AB (@samhed)
3 | - Pierre Ossman for Cendio AB (@CendioOssman)
4 | maintainersEmeritus:
5 | - Joel Martin (@kanaka)
6 | - Solly Ross (@directxman12)
7 | - @astrand
8 | contributors:
9 | # There are a bunch of people that should be here.
10 | # If you want to be on this list, feel free send a PR
11 | # to add yourself.
12 | - jalf
13 | - NTT corp.
14 |
--------------------------------------------------------------------------------
/.github/workflows/translate.yml:
--------------------------------------------------------------------------------
1 | name: Translate
2 |
3 | on: [push, pull_request]
4 |
5 | jobs:
6 | translate:
7 | runs-on: ubuntu-latest
8 | steps:
9 | - uses: actions/checkout@v4
10 | - uses: actions/setup-node@v4
11 | - run: npm update
12 | - run: sudo apt-get install gettext
13 | - run: make -C po update-pot
14 | - run: make -C po update-po
15 | - run: make -C po update-js
16 |
--------------------------------------------------------------------------------
/utils/b64-to-binary.pl:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env perl
2 | use MIME::Base64;
3 |
4 | for (<>) {
5 | unless (/^'([{}])(\d+)\1(.+?)',$/) {
6 | print;
7 | next;
8 | }
9 |
10 | my ($dir, $amt, $b64) = ($1, $2, $3);
11 |
12 | my $decoded = MIME::Base64::decode($b64) or die "Could not base64-decode line `$_`";
13 |
14 | my $decoded_escaped = join "", map { "\\x$_" } unpack("(H2)*", $decoded);
15 |
16 | print "'${dir}${amt}${dir}${decoded_escaped}',\n";
17 | }
18 |
--------------------------------------------------------------------------------
/tests/test.int.js:
--------------------------------------------------------------------------------
1 | import { toUnsigned32bit, toSigned32bit } from '../core/util/int.js';
2 |
3 | describe('Integer casting', function () {
4 | it('should cast unsigned to signed', function () {
5 | let expected = 4294967286;
6 | expect(toUnsigned32bit(-10)).to.equal(expected);
7 | });
8 |
9 | it('should cast signed to unsigned', function () {
10 | let expected = -10;
11 | expect(toSigned32bit(4294967286)).to.equal(expected);
12 | });
13 | });
14 |
--------------------------------------------------------------------------------
/.github/workflows/lint.yml:
--------------------------------------------------------------------------------
1 | name: Lint
2 |
3 | on: [push, pull_request]
4 |
5 | jobs:
6 | eslint:
7 | runs-on: ubuntu-latest
8 | steps:
9 | - uses: actions/checkout@v4
10 | - uses: actions/setup-node@v4
11 | - run: npm update
12 | - run: npm run lint
13 | html:
14 | runs-on: ubuntu-latest
15 | steps:
16 | - uses: actions/checkout@v4
17 | - uses: actions/setup-node@v4
18 | - run: npm update
19 | - run: git ls-tree --name-only -r HEAD | grep -E "[.](html|css)$" | xargs ./utils/validate
20 |
--------------------------------------------------------------------------------
/utils/README.md:
--------------------------------------------------------------------------------
1 | ## WebSockets Proxy/Bridge
2 |
3 | Websockify has been forked out into its own project. `novnc_proxy` will
4 | automatically download it here if it is not already present and not
5 | installed as system-wide.
6 |
7 | For more detailed description and usage information please refer to
8 | the [websockify README](https://github.com/novnc/websockify/blob/master/README.md).
9 |
10 | The other versions of websockify (C, Node.js) and the associated test
11 | programs have been moved to
12 | [websockify](https://github.com/novnc/websockify). Websockify was
13 | formerly named wsproxy.
14 |
15 |
--------------------------------------------------------------------------------
/vendor/pako/lib/zlib/messages.js:
--------------------------------------------------------------------------------
1 | export default {
2 | 2: 'need dictionary', /* Z_NEED_DICT 2 */
3 | 1: 'stream end', /* Z_STREAM_END 1 */
4 | 0: '', /* Z_OK 0 */
5 | '-1': 'file error', /* Z_ERRNO (-1) */
6 | '-2': 'stream error', /* Z_STREAM_ERROR (-2) */
7 | '-3': 'data error', /* Z_DATA_ERROR (-3) */
8 | '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */
9 | '-5': 'buffer error', /* Z_BUF_ERROR (-5) */
10 | '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */
11 | };
12 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 |
5 | ---
6 |
7 | **Is your feature request related to a problem? Please describe.**
8 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
9 |
10 | **Describe the solution you'd like**
11 | A clear and concise description of what you want to happen.
12 |
13 | **Describe alternatives you've considered**
14 | A clear and concise description of any alternative solutions or features you've considered.
15 |
16 | **Additional context**
17 | Add any other context or screenshots about the feature request here.
18 |
--------------------------------------------------------------------------------
/.github/workflows/test.yml:
--------------------------------------------------------------------------------
1 | name: Test
2 |
3 | on: [push, pull_request]
4 |
5 | jobs:
6 | test:
7 | strategy:
8 | matrix:
9 | os:
10 | - ubuntu-latest
11 | - windows-latest
12 | browser:
13 | - ChromeHeadless
14 | - FirefoxHeadless
15 | include:
16 | - os: macos-latest
17 | browser: Safari
18 | - os: windows-latest
19 | browser: EdgeHeadless
20 | fail-fast: false
21 | runs-on: ${{ matrix.os }}
22 | steps:
23 | - uses: actions/checkout@v4
24 | - uses: actions/setup-node@v4
25 | - run: npm update
26 | - run: npm run test
27 | env:
28 | TEST_BROWSER_NAME: ${{ matrix.browser }}
29 |
--------------------------------------------------------------------------------
/core/decoders/copyrect.js:
--------------------------------------------------------------------------------
1 | /*
2 | * noVNC: HTML5 VNC client
3 | * Copyright (C) 2019 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 | export default class CopyRectDecoder {
11 | decodeRect(x, y, width, height, sock, display, depth) {
12 | if (sock.rQwait("COPYRECT", 4)) {
13 | return false;
14 | }
15 |
16 | let deltaX = sock.rQshift16();
17 | let deltaY = sock.rQshift16();
18 |
19 | if ((width === 0) || (height === 0)) {
20 | return true;
21 | }
22 |
23 | display.copyImage(deltaX, deltaY, x, y, width, height);
24 |
25 | return true;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/tests/vnc_playback.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | VNC playback
5 |
6 |
7 |
8 |
9 | Iterations:
10 | Perftest:
11 | Realtime:
12 |
13 |
14 |
15 |
16 |
17 | Results:
18 |
19 |
20 |
21 |
22 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/vendor/pako/lib/zlib/adler32.js:
--------------------------------------------------------------------------------
1 | // Note: adler32 takes 12% for level 0 and 2% for level 6.
2 | // It doesn't worth to make additional optimizationa as in original.
3 | // Small size is preferable.
4 |
5 | export default function adler32(adler, buf, len, pos) {
6 | var s1 = (adler & 0xffff) |0,
7 | s2 = ((adler >>> 16) & 0xffff) |0,
8 | n = 0;
9 |
10 | while (len !== 0) {
11 | // Set limit ~ twice less than 5552, to keep
12 | // s2 in 31-bits, because we force signed ints.
13 | // in other case %= will fail.
14 | n = len > 2000 ? 2000 : len;
15 | len -= n;
16 |
17 | do {
18 | s1 = (s1 + buf[pos++]) |0;
19 | s2 = (s2 + s1) |0;
20 | } while (--n);
21 |
22 | s1 %= 65521;
23 | s2 %= 65521;
24 | }
25 |
26 | return (s1 | (s2 << 16)) |0;
27 | }
28 |
--------------------------------------------------------------------------------
/core/decoders/tightpng.js:
--------------------------------------------------------------------------------
1 | /*
2 | * noVNC: HTML5 VNC client
3 | * Copyright (C) 2019 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 TightDecoder from './tight.js';
11 |
12 | export default class TightPNGDecoder extends TightDecoder {
13 | _pngRect(x, y, width, height, sock, display, depth) {
14 | let data = this._readData(sock);
15 | if (data === null) {
16 | return false;
17 | }
18 |
19 | display.imageRect(x, y, width, height, "image/png", data);
20 |
21 | return true;
22 | }
23 |
24 | _basicRect(ctl, x, y, width, height, sock, display, depth) {
25 | throw new Error("BasicCompression received in TightPNG rect");
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/core/util/strings.js:
--------------------------------------------------------------------------------
1 | /*
2 | * noVNC: HTML5 VNC client
3 | * Copyright (C) 2019 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 | // Decode from UTF-8
10 | export function decodeUTF8(utf8string, allowLatin1=false) {
11 | try {
12 | return decodeURIComponent(escape(utf8string));
13 | } catch (e) {
14 | if (e instanceof URIError) {
15 | if (allowLatin1) {
16 | // If we allow Latin1 we can ignore any decoding fails
17 | // and in these cases return the original string
18 | return utf8string;
19 | }
20 | }
21 | throw e;
22 | }
23 | }
24 |
25 | // Encode to UTF-8
26 | export function encodeUTF8(DOMString) {
27 | return unescape(encodeURIComponent(DOMString));
28 | }
29 |
--------------------------------------------------------------------------------
/core/util/element.js:
--------------------------------------------------------------------------------
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 |
9 | /*
10 | * HTML element utility functions
11 | */
12 |
13 | export function clientToElement(x, y, elem) {
14 | const bounds = elem.getBoundingClientRect();
15 | let pos = { x: 0, y: 0 };
16 | // Clip to target bounds
17 | if (x < bounds.left) {
18 | pos.x = 0;
19 | } else if (x >= bounds.right) {
20 | pos.x = bounds.width - 1;
21 | } else {
22 | pos.x = x - bounds.left;
23 | }
24 | if (y < bounds.top) {
25 | pos.y = 0;
26 | } else if (y >= bounds.bottom) {
27 | pos.y = bounds.height - 1;
28 | } else {
29 | pos.y = y - bounds.top;
30 | }
31 | return pos;
32 | }
33 |
--------------------------------------------------------------------------------
/app/styles/constants.css:
--------------------------------------------------------------------------------
1 | /*
2 | * noVNC general CSS constant variables
3 | * Copyright (C) 2025 The noVNC authors
4 | * noVNC is licensed under the MPL 2.0 (see LICENSE.txt)
5 | * This file is licensed under the 2-Clause BSD license (see LICENSE.txt).
6 | */
7 |
8 | /* ---------- COLORS ----------- */
9 |
10 | :root {
11 | --novnc-grey: rgb(128, 128, 128);
12 | --novnc-lightgrey: rgb(192, 192, 192);
13 | --novnc-darkgrey: rgb(92, 92, 92);
14 |
15 | /* Transparent to make button colors adapt to the background */
16 | --novnc-buttongrey: rgba(192, 192, 192, 0.5);
17 |
18 | --novnc-blue: rgb(110, 132, 163);
19 | --novnc-lightblue: rgb(74, 144, 217);
20 | --novnc-darkblue: rgb(83, 99, 122);
21 |
22 | --novnc-green: rgb(0, 128, 0);
23 | --novnc-yellow: rgb(255, 255, 0);
24 | }
25 |
26 | /* ------ MISC PROPERTIES ------ */
27 |
28 | :root {
29 | --input-xpadding: 1em;
30 | }
31 |
--------------------------------------------------------------------------------
/vendor/pako/lib/zlib/crc32.js:
--------------------------------------------------------------------------------
1 | // Note: we can't get significant speed boost here.
2 | // So write code to minimize size - no pregenerated tables
3 | // and array tools dependencies.
4 |
5 |
6 | // Use ordinary array, since untyped makes no boost here
7 | export default function makeTable() {
8 | var c, table = [];
9 |
10 | for (var n = 0; n < 256; n++) {
11 | c = n;
12 | for (var k = 0; k < 8; k++) {
13 | c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));
14 | }
15 | table[n] = c;
16 | }
17 |
18 | return table;
19 | }
20 |
21 | // Create table on load. Just 255 signed longs. Not a problem.
22 | var crcTable = makeTable();
23 |
24 |
25 | function crc32(crc, buf, len, pos) {
26 | var t = crcTable,
27 | end = pos + len;
28 |
29 | crc ^= -1;
30 |
31 | for (var i = pos; i < end; i++) {
32 | crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];
33 | }
34 |
35 | return (crc ^ (-1)); // >>> 0;
36 | }
37 |
--------------------------------------------------------------------------------
/vendor/pako/lib/zlib/zstream.js:
--------------------------------------------------------------------------------
1 | export default function ZStream() {
2 | /* next input byte */
3 | this.input = null; // JS specific, because we have no pointers
4 | this.next_in = 0;
5 | /* number of bytes available at input */
6 | this.avail_in = 0;
7 | /* total number of input bytes read so far */
8 | this.total_in = 0;
9 | /* next output byte should be put there */
10 | this.output = null; // JS specific, because we have no pointers
11 | this.next_out = 0;
12 | /* remaining free space at output */
13 | this.avail_out = 0;
14 | /* total number of bytes output so far */
15 | this.total_out = 0;
16 | /* last error message, NULL if no error */
17 | this.msg = ''/*Z_NULL*/;
18 | /* not visible by applications */
19 | this.state = null;
20 | /* best guess about the data type: binary or text */
21 | this.data_type = 2/*Z_UNKNOWN*/;
22 | /* adler32 value of the uncompressed data */
23 | this.adler = 0;
24 | }
25 |
--------------------------------------------------------------------------------
/core/crypto/bigint.js:
--------------------------------------------------------------------------------
1 | export function modPow(b, e, m) {
2 | let r = 1n;
3 | b = b % m;
4 | while (e > 0n) {
5 | if ((e & 1n) === 1n) {
6 | r = (r * b) % m;
7 | }
8 | e = e >> 1n;
9 | b = (b * b) % m;
10 | }
11 | return r;
12 | }
13 |
14 | export function bigIntToU8Array(bigint, padLength=0) {
15 | let hex = bigint.toString(16);
16 | if (padLength === 0) {
17 | padLength = Math.ceil(hex.length / 2);
18 | }
19 | hex = hex.padStart(padLength * 2, '0');
20 | const length = hex.length / 2;
21 | const arr = new Uint8Array(length);
22 | for (let i = 0; i < length; i++) {
23 | arr[i] = parseInt(hex.slice(i * 2, i * 2 + 2), 16);
24 | }
25 | return arr;
26 | }
27 |
28 | export function u8ArrayToBigInt(arr) {
29 | let hex = '0x';
30 | for (let i = 0; i < arr.length; i++) {
31 | hex += arr[i].toString(16).padStart(2, '0');
32 | }
33 | return BigInt(hex);
34 | }
35 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 |
5 | ---
6 |
7 | **Describe the bug**
8 | A clear and concise description of what the bug is.
9 |
10 | **To reproduce**
11 | Steps to reproduce the behavior:
12 | 1. Go to '...'
13 | 2. Click on '....'
14 | 3. Scroll down to '....'
15 | 4. See error
16 |
17 | **Expected behavior**
18 | A clear and concise description of what you expected to happen.
19 |
20 | **Screenshots**
21 | If applicable, add screenshots to help explain your problem.
22 |
23 | **Client (please complete the following information):**
24 | - OS: [e.g. iOS]
25 | - Browser: [e.g. chrome, safari]
26 | - Browser version: [e.g. 22]
27 |
28 | **Server (please complete the following information):**
29 | - noVNC version: [e.g. 1.0.0 or git commit id]
30 | - VNC server: [e.g. QEMU, TigerVNC]
31 | - WebSocket proxy: [e.g. websockify]
32 |
33 | **Additional context**
34 | Add any other context about the problem here.
35 |
--------------------------------------------------------------------------------
/utils/u2x11:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | #
3 | # Convert "U+..." commented entries in /usr/include/X11/keysymdef.h
4 | # into JavaScript for use by noVNC. Note this is likely to produce
5 | # a few duplicate properties with clashing values, that will need
6 | # resolving manually.
7 | #
8 | # Colin Dean
9 | #
10 |
11 | regex="^#define[ \t]+XK_[A-Za-z0-9_]+[ \t]+0x([0-9a-fA-F]+)[ \t]+\/\*[ \t]+U\+([0-9a-fA-F]+)[ \t]+[^*]+.[ \t]+\*\/[ \t]*$"
12 | echo "unicodeTable = {"
13 | while read line; do
14 | if echo "${line}" | egrep -qs "${regex}"; then
15 |
16 | x11=$(echo "${line}" | sed -r "s/${regex}/\1/")
17 | vnc=$(echo "${line}" | sed -r "s/${regex}/\2/")
18 |
19 | if echo "${vnc}" | egrep -qs "^00[2-9A-F][0-9A-F]$"; then
20 | : # skip ISO Latin-1 (U+0020 to U+00FF) as 1-to-1 mapping
21 | else
22 | # note 1-to-1 is possible (e.g. for Euro symbol, U+20AC)
23 | echo " 0x${vnc} : 0x${x11},"
24 | fi
25 | fi
26 | done < /usr/include/X11/keysymdef.h | uniq
27 | echo "};"
28 |
29 |
--------------------------------------------------------------------------------
/core/util/eventtarget.js:
--------------------------------------------------------------------------------
1 | /*
2 | * noVNC: HTML5 VNC client
3 | * Copyright (C) 2019 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 | export default class EventTargetMixin {
10 | constructor() {
11 | this._listeners = new Map();
12 | }
13 |
14 | addEventListener(type, callback) {
15 | if (!this._listeners.has(type)) {
16 | this._listeners.set(type, new Set());
17 | }
18 | this._listeners.get(type).add(callback);
19 | }
20 |
21 | removeEventListener(type, callback) {
22 | if (this._listeners.has(type)) {
23 | this._listeners.get(type).delete(callback);
24 | }
25 | }
26 |
27 | dispatchEvent(event) {
28 | if (!this._listeners.has(event.type)) {
29 | return true;
30 | }
31 | this._listeners.get(event.type)
32 | .forEach(callback => callback.call(this, event));
33 | return !event.defaultPrevented;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/po/Makefile:
--------------------------------------------------------------------------------
1 | all:
2 | .PHONY: update-po update-js update-pot
3 | .PHONY: FORCE
4 |
5 | LINGUAS := cs de el es fr hr hu it ja ko nl pl pt_BR ru sv tr zh_CN zh_TW
6 |
7 | VERSION := $(shell grep '"version"' ../package.json | cut -d '"' -f 4)
8 |
9 | POFILES := $(addsuffix .po,$(LINGUAS))
10 | JSONFILES := $(addprefix ../app/locale/,$(addsuffix .json,$(LINGUAS)))
11 |
12 | update-po: $(POFILES)
13 | update-js: $(JSONFILES)
14 |
15 | %.po: FORCE
16 | msgmerge --update --lang=$* $@ noVNC.pot
17 | ../app/locale/%.json: FORCE
18 | ./po2js $*.po $@
19 |
20 | update-pot:
21 | xgettext --output=noVNC.js.pot \
22 | --copyright-holder="The noVNC authors" \
23 | --package-name="noVNC" \
24 | --package-version="$(VERSION)" \
25 | --msgid-bugs-address="novnc@googlegroups.com" \
26 | --add-comments=TRANSLATORS: \
27 | --from-code=UTF-8 \
28 | --sort-by-file \
29 | ../app/*.js \
30 | ../core/*.js \
31 | ../core/input/*.js
32 | ./xgettext-html --output=noVNC.html.pot \
33 | ../vnc.html
34 | msgcat --output-file=noVNC.pot \
35 | --sort-by-file noVNC.js.pot noVNC.html.pot
36 | rm -f noVNC.js.pot noVNC.html.pot
37 |
--------------------------------------------------------------------------------
/vendor/pako/LICENSE:
--------------------------------------------------------------------------------
1 | (The MIT License)
2 |
3 | Copyright (C) 2014-2016 by Vitaly Puzrin
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/docs/LIBRARY.md:
--------------------------------------------------------------------------------
1 | # Using the noVNC JavaScript library
2 |
3 | This document describes how to make use of the noVNC JavaScript library for
4 | integration in your own VNC client application. If you wish to embed the more
5 | complete noVNC application with its included user interface then please see
6 | our [embedding documentation](EMBEDDING.md).
7 |
8 | ## API
9 |
10 | The API of noVNC consists of a single object called `RFB`. The formal
11 | documentation for that object can be found in our [API documentation](API.md).
12 |
13 | ## Example
14 |
15 | noVNC includes a small example application called `vnc_lite.html`. This does
16 | not make use of all the features of noVNC, but is a good start to see how to
17 | do things.
18 |
19 | ## Conversion of modules
20 |
21 | noVNC is written using ECMAScript 6 modules. This is not supported by older
22 | versions of Node.js. To use noVNC with those older versions of Node.js the
23 | library must first be converted.
24 |
25 | Fortunately noVNC includes a script to handle this conversion. Please follow
26 | the following steps:
27 |
28 | 1. Install Node.js
29 | 2. Run `npm install` in the noVNC directory
30 |
31 | The result of the conversion is available in the `lib/` directory.
32 |
--------------------------------------------------------------------------------
/vendor/pako/lib/utils/common.js:
--------------------------------------------------------------------------------
1 | // reduce buffer size, avoiding mem copy
2 | export function shrinkBuf (buf, size) {
3 | if (buf.length === size) { return buf; }
4 | if (buf.subarray) { return buf.subarray(0, size); }
5 | buf.length = size;
6 | return buf;
7 | };
8 |
9 |
10 | export function arraySet (dest, src, src_offs, len, dest_offs) {
11 | if (src.subarray && dest.subarray) {
12 | dest.set(src.subarray(src_offs, src_offs + len), dest_offs);
13 | return;
14 | }
15 | // Fallback to ordinary array
16 | for (var i = 0; i < len; i++) {
17 | dest[dest_offs + i] = src[src_offs + i];
18 | }
19 | }
20 |
21 | // Join array of chunks to single array.
22 | export function flattenChunks (chunks) {
23 | var i, l, len, pos, chunk, result;
24 |
25 | // calculate data length
26 | len = 0;
27 | for (i = 0, l = chunks.length; i < l; i++) {
28 | len += chunks[i].length;
29 | }
30 |
31 | // join chunks
32 | result = new Uint8Array(len);
33 | pos = 0;
34 | for (i = 0, l = chunks.length; i < l; i++) {
35 | chunk = chunks[i];
36 | result.set(chunk, pos);
37 | pos += chunk.length;
38 | }
39 |
40 | return result;
41 | }
42 |
43 | export var Buf8 = Uint8Array;
44 | export var Buf16 = Uint16Array;
45 | export var Buf32 = Int32Array;
46 |
--------------------------------------------------------------------------------
/core/decoders/rre.js:
--------------------------------------------------------------------------------
1 | /*
2 | * noVNC: HTML5 VNC client
3 | * Copyright (C) 2019 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 | export default class RREDecoder {
11 | constructor() {
12 | this._subrects = 0;
13 | }
14 |
15 | decodeRect(x, y, width, height, sock, display, depth) {
16 | if (this._subrects === 0) {
17 | if (sock.rQwait("RRE", 4 + 4)) {
18 | return false;
19 | }
20 |
21 | this._subrects = sock.rQshift32();
22 |
23 | let color = sock.rQshiftBytes(4); // Background
24 | display.fillRect(x, y, width, height, color);
25 | }
26 |
27 | while (this._subrects > 0) {
28 | if (sock.rQwait("RRE", 4 + 8)) {
29 | return false;
30 | }
31 |
32 | let color = sock.rQshiftBytes(4);
33 | let sx = sock.rQshift16();
34 | let sy = sock.rQshift16();
35 | let swidth = sock.rQshift16();
36 | let sheight = sock.rQshift16();
37 | display.fillRect(x + sx, y + sy, swidth, sheight, color);
38 |
39 | this._subrects--;
40 | }
41 |
42 | return true;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/snap/local/svc_wrapper.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # `snapctl get services` returns a JSON array, example:
4 | #{
5 | #"n6801": {
6 | # "listen": 6801,
7 | # "vnc": "localhost:5901"
8 | #},
9 | #"n6802": {
10 | # "listen": 6802,
11 | # "vnc": "localhost:5902"
12 | #}
13 | #}
14 | snapctl get services | jq -c '.[]' | while read service; do # for each service the user specified..
15 | # get the important data for the service (listen port, VNC host:port)
16 | listen_port="$(echo $service | jq --raw-output '.listen')"
17 | vnc_host_port="$(echo $service | jq --raw-output '.vnc')" # --raw-output removes any quotation marks from the output
18 |
19 | # check whether those values are valid
20 | expr "$listen_port" : '^[0-9]\+$' > /dev/null
21 | listen_port_valid=$?
22 | if [ ! $listen_port_valid ] || [ -z "$vnc_host_port" ]; then
23 | # invalid values mean the service is disabled, do nothing except for printing a message (logged in /var/log/system or systemd journal)
24 | echo "novnc: not starting service ${service} with listen_port ${listen_port} and vnc_host_port ${vnc_host_port}"
25 | else
26 | # start (and fork with '&') the service using the specified listen port and VNC host:port
27 | $SNAP/novnc_proxy --listen $listen_port --vnc $vnc_host_port &
28 | fi
29 | done
30 |
--------------------------------------------------------------------------------
/tests/test.base64.js:
--------------------------------------------------------------------------------
1 | import Base64 from '../core/base64.js';
2 |
3 | describe('Base64 tools', function () {
4 | "use strict";
5 |
6 | const BIN_ARR = new Array(256);
7 | for (let i = 0; i < 256; i++) {
8 | BIN_ARR[i] = i;
9 | }
10 |
11 | const B64_STR = "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/w==";
12 |
13 |
14 | describe('encode', function () {
15 | it('should encode a binary string into Base64', function () {
16 | const encoded = Base64.encode(BIN_ARR);
17 | expect(encoded).to.equal(B64_STR);
18 | });
19 | });
20 |
21 | describe('decode', function () {
22 | it('should decode a Base64 string into a normal string', function () {
23 | const decoded = Base64.decode(B64_STR);
24 | expect(decoded).to.deep.equal(BIN_ARR);
25 | });
26 |
27 | it('should throw an error if we have extra characters at the end of the string', function () {
28 | expect(() => Base64.decode(B64_STR+'abcdef')).to.throw(Error);
29 | });
30 | });
31 | });
32 |
--------------------------------------------------------------------------------
/docs/LICENSE.BSD-2-Clause:
--------------------------------------------------------------------------------
1 | Copyright (c) ,
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are met:
6 |
7 | * Redistributions of source code must retain the above copyright
8 | notice, this list of conditions and the following disclaimer.
9 | * Redistributions in binary form must reproduce the above copyright
10 | notice, this list of conditions and the following disclaimer in the
11 | documentation and/or other materials provided with the distribution.
12 |
13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
14 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16 | DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
17 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
20 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 |
--------------------------------------------------------------------------------
/vendor/pako/lib/zlib/gzheader.js:
--------------------------------------------------------------------------------
1 | export default function GZheader() {
2 | /* true if compressed data believed to be text */
3 | this.text = 0;
4 | /* modification time */
5 | this.time = 0;
6 | /* extra flags (not used when writing a gzip file) */
7 | this.xflags = 0;
8 | /* operating system */
9 | this.os = 0;
10 | /* pointer to extra field or Z_NULL if none */
11 | this.extra = null;
12 | /* extra field length (valid if extra != Z_NULL) */
13 | this.extra_len = 0; // Actually, we don't need it in JS,
14 | // but leave for few code modifications
15 |
16 | //
17 | // Setup limits is not necessary because in js we should not preallocate memory
18 | // for inflate use constant limit in 65536 bytes
19 | //
20 |
21 | /* space at extra (only when reading header) */
22 | // this.extra_max = 0;
23 | /* pointer to zero-terminated file name or Z_NULL */
24 | this.name = '';
25 | /* space at name (only when reading header) */
26 | // this.name_max = 0;
27 | /* pointer to zero-terminated comment or Z_NULL */
28 | this.comment = '';
29 | /* space at comment (only when reading header) */
30 | // this.comm_max = 0;
31 | /* true if there was or will be a header crc */
32 | this.hcrc = 0;
33 | /* true when done reading gzip header (not used when writing a gzip file) */
34 | this.done = false;
35 | }
36 |
--------------------------------------------------------------------------------
/core/decoders/zlib.js:
--------------------------------------------------------------------------------
1 | /*
2 | * noVNC: HTML5 VNC client
3 | * Copyright (C) 2024 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 Inflator from "../inflator.js";
11 |
12 | export default class ZlibDecoder {
13 | constructor() {
14 | this._zlib = new Inflator();
15 | this._length = 0;
16 | }
17 |
18 | decodeRect(x, y, width, height, sock, display, depth) {
19 | if ((width === 0) || (height === 0)) {
20 | return true;
21 | }
22 |
23 | if (this._length === 0) {
24 | if (sock.rQwait("ZLIB", 4)) {
25 | return false;
26 | }
27 |
28 | this._length = sock.rQshift32();
29 | }
30 |
31 | if (sock.rQwait("ZLIB", this._length)) {
32 | return false;
33 | }
34 |
35 | let data = new Uint8Array(sock.rQshiftBytes(this._length, false));
36 | this._length = 0;
37 |
38 | this._zlib.setInput(data);
39 | data = this._zlib.inflate(width * height * 4);
40 | this._zlib.setInput(null);
41 |
42 | // Max sure the image is fully opaque
43 | for (let i = 0; i < width * height; i++) {
44 | data[i * 4 + 3] = 255;
45 | }
46 |
47 | display.blitImage(x, y, width, height, data, 0);
48 |
49 | return true;
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/app/images/icons/Makefile:
--------------------------------------------------------------------------------
1 | BROWSER_SIZES := 16 24 32 48 64
2 | #ANDROID_SIZES := 72 96 144 192
3 | # FIXME: The ICO is limited to 8 icons due to a Chrome bug:
4 | # https://bugs.chromium.org/p/chromium/issues/detail?id=1381393
5 | ANDROID_SIZES := 96 144 192
6 | WEB_ICON_SIZES := $(BROWSER_SIZES) $(ANDROID_SIZES)
7 |
8 | #IOS_1X_SIZES := 20 29 40 76 # No such devices exist anymore
9 | IOS_2X_SIZES := 40 58 80 120 152 167
10 | IOS_3X_SIZES := 60 87 120 180
11 | ALL_IOS_SIZES := $(IOS_1X_SIZES) $(IOS_2X_SIZES) $(IOS_3X_SIZES)
12 |
13 | ALL_ICONS := \
14 | $(ALL_IOS_SIZES:%=novnc-ios-%.png) \
15 | novnc.ico
16 |
17 | all: $(ALL_ICONS)
18 |
19 | # Our testing shows that the ICO file need to be sorted in largest to
20 | # smallest to get the apporpriate behviour
21 | WEB_ICON_SIZES_REVERSE := $(shell echo $(WEB_ICON_SIZES) | tr ' ' '\n' | sort -nr | tr '\n' ' ')
22 | WEB_BASE_ICONS := $(WEB_ICON_SIZES_REVERSE:%=novnc-%.png)
23 | .INTERMEDIATE: $(WEB_BASE_ICONS)
24 |
25 | novnc.ico: $(WEB_BASE_ICONS)
26 | convert $(WEB_BASE_ICONS) "$@"
27 |
28 | # General conversion
29 | novnc-%.png: novnc-icon.svg
30 | convert -depth 8 -background transparent \
31 | -size $*x$* "$(lastword $^)" "$@"
32 |
33 | # iOS icons use their own SVG
34 | novnc-ios-%.png: novnc-ios-icon.svg
35 | convert -depth 8 -background transparent \
36 | -size $*x$* "$(lastword $^)" "$@"
37 |
38 | # The smallest sizes are generated using a different SVG
39 | novnc-16.png novnc-24.png novnc-32.png: novnc-icon-sm.svg
40 |
41 | clean:
42 | rm -f *.png
43 |
--------------------------------------------------------------------------------
/vendor/pako/lib/zlib/constants.js:
--------------------------------------------------------------------------------
1 | export default {
2 |
3 | /* Allowed flush values; see deflate() and inflate() below for details */
4 | Z_NO_FLUSH: 0,
5 | Z_PARTIAL_FLUSH: 1,
6 | Z_SYNC_FLUSH: 2,
7 | Z_FULL_FLUSH: 3,
8 | Z_FINISH: 4,
9 | Z_BLOCK: 5,
10 | Z_TREES: 6,
11 |
12 | /* Return codes for the compression/decompression functions. Negative values
13 | * are errors, positive values are used for special but normal events.
14 | */
15 | Z_OK: 0,
16 | Z_STREAM_END: 1,
17 | Z_NEED_DICT: 2,
18 | Z_ERRNO: -1,
19 | Z_STREAM_ERROR: -2,
20 | Z_DATA_ERROR: -3,
21 | //Z_MEM_ERROR: -4,
22 | Z_BUF_ERROR: -5,
23 | //Z_VERSION_ERROR: -6,
24 |
25 | /* compression levels */
26 | Z_NO_COMPRESSION: 0,
27 | Z_BEST_SPEED: 1,
28 | Z_BEST_COMPRESSION: 9,
29 | Z_DEFAULT_COMPRESSION: -1,
30 |
31 |
32 | Z_FILTERED: 1,
33 | Z_HUFFMAN_ONLY: 2,
34 | Z_RLE: 3,
35 | Z_FIXED: 4,
36 | Z_DEFAULT_STRATEGY: 0,
37 |
38 | /* Possible values of the data_type field (though see inflate()) */
39 | Z_BINARY: 0,
40 | Z_TEXT: 1,
41 | //Z_ASCII: 1, // = Z_TEXT (deprecated)
42 | Z_UNKNOWN: 2,
43 |
44 | /* The deflate compression method */
45 | Z_DEFLATED: 8
46 | //Z_NULL: null // Use -1 or null inline, depending on var type
47 | };
48 |
--------------------------------------------------------------------------------
/po/po2js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 | /*
3 | * ps2js: gettext .po to noVNC .js converter
4 | * Copyright (C) 2018 The noVNC authors
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | import { program } from 'commander';
21 | import fs from 'fs';
22 | import pofile from "pofile";
23 |
24 | program
25 | .argument('')
26 | .argument('