Skip to content

Commit 3b6d9b5

Browse files
authored
Merge pull request #27 from codio/17701_update
update
2 parents e6695a1 + f7f5ae4 commit 3b6d9b5

25 files changed

Lines changed: 1705 additions & 411 deletions

.github/workflows/deploy.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
jobs:
1010
npm:
1111
runs-on: ubuntu-latest
12+
permissions:
13+
id-token: write
14+
contents: read
1215
steps:
1316
- uses: actions/checkout@v4
1417
- run: |
@@ -18,6 +21,9 @@ jobs:
1821
if: github.event_name != 'release'
1922
- uses: actions/setup-node@v4
2023
with:
24+
# Node 24 is needed to get npm > 11.5.1, which is a requirement for
25+
# OIDC auth.
26+
node-version: 24
2127
# Needs to be explicitly specified for auth to work
2228
registry-url: 'https://registry.npmjs.org'
2329
- run: npm install
@@ -26,22 +32,16 @@ jobs:
2632
name: npm
2733
path: lib
2834
- run: npm publish --access public
29-
env:
30-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
3135
if: |
3236
github.repository == 'novnc/noVNC' &&
3337
github.event_name == 'release' &&
3438
!github.event.release.prerelease
3539
- run: npm publish --access public --tag beta
36-
env:
37-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
3840
if: |
3941
github.repository == 'novnc/noVNC' &&
4042
github.event_name == 'release' &&
4143
github.event.release.prerelease
4244
- run: npm publish --access public --tag dev
43-
env:
44-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
4545
if: |
4646
github.repository == 'novnc/noVNC' &&
4747
github.event_name == 'push' &&

app/codio-sentry.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
export const init = () => {
2+
const prodRe = /https:\/\/.+\.codio\.io$/;
3+
const prodUkRe = /https:\/\/.+\.codio-box\.uk$/;
4+
const isProd = prodRe.test(location.origin) || prodUkRe.test(location.origin);
5+
6+
window.Sentry?.init({
7+
// No need to configure DSN here, it is already configured in the loader script
8+
// You can add any additional configuration here
9+
dsn: "https://d08e273c89d12afcde41b3ec30d37ace@o108517.ingest.us.sentry.io/4505750448439296",
10+
release: 'TAG_VERSION',
11+
environment: isProd ? 'production' : 'development',
12+
ignoreErrors: [
13+
'ResizeObserver loop completed with undelivered notifications' // https://bugzilla.mozilla.org/show_bug.cgi?id=1685038
14+
]
15+
});
16+
};
17+
18+

app/locale/hu.json

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
{
2+
"Running without HTTPS is not recommended, crashes or other issues are likely.": "HTTPS nélkül futtatni nem ajánlott, összeomlások vagy más problémák várhatók.",
3+
"Connecting...": "Kapcsolódás...",
4+
"Disconnecting...": "Kapcsolat bontása...",
5+
"Reconnecting...": "Újrakapcsolódás...",
6+
"Internal error": "Belső hiba",
7+
"Failed to connect to server: ": "Nem sikerült csatlakozni a szerverhez: ",
8+
"Connected (encrypted) to ": "Kapcsolódva (titkosítva) ehhez: ",
9+
"Connected (unencrypted) to ": "Kapcsolódva (titkosítatlanul) ehhez: ",
10+
"Something went wrong, connection is closed": "Valami hiba történt, a kapcsolat lezárult",
11+
"Failed to connect to server": "Nem sikerült csatlakozni a szerverhez",
12+
"Disconnected": "Kapcsolat bontva",
13+
"New connection has been rejected with reason: ": "Az új kapcsolat elutasítva, indok: ",
14+
"New connection has been rejected": "Az új kapcsolat elutasítva",
15+
"Credentials are required": "Hitelesítő adatok szükségesek",
16+
"noVNC encountered an error:": "A noVNC hibát észlelt:",
17+
"Hide/Show the control bar": "Vezérlősáv elrejtése/megjelenítése",
18+
"Drag": "Húzás",
19+
"Move/Drag viewport": "Nézet mozgatása/húzása",
20+
"Keyboard": "Billentyűzet",
21+
"Show keyboard": "Billentyűzet megjelenítése",
22+
"Extra keys": "Extra billentyűk",
23+
"Show extra keys": "Extra billentyűk megjelenítése",
24+
"Ctrl": "Ctrl",
25+
"Toggle Ctrl": "Ctrl lenyomása/felengedése",
26+
"Alt": "Alt",
27+
"Toggle Alt": "Alt lenyomása/felengedése",
28+
"Toggle Windows": "Windows lenyomása/felengedése",
29+
"Windows": "Windows",
30+
"Send Tab": "Tab küldése",
31+
"Tab": "Tab",
32+
"Esc": "Esc",
33+
"Send Escape": "Escape küldése",
34+
"Ctrl+Alt+Del": "Ctrl+Alt+Del",
35+
"Send Ctrl-Alt-Del": "Ctrl-Alt-Del küldése",
36+
"Shutdown/Reboot": "Leállítás/Újraindítás",
37+
"Shutdown/Reboot...": "Leállítás/Újraindítás...",
38+
"Power": "Bekapcsolás",
39+
"Shutdown": "Leállítás",
40+
"Reboot": "Újraindítás",
41+
"Reset": "Reset",
42+
"Clipboard": "Vágólap",
43+
"Edit clipboard content in the textarea below.": "Itt tudod módosítani a vágólap tartalmát.",
44+
"Full screen": "Teljes képernyő",
45+
"Settings": "Beállítások",
46+
"Shared mode": "Megosztott mód",
47+
"View only": "Csak megtekintés",
48+
"Clip to window": "Ablakhoz igazítás",
49+
"Scaling mode:": "Méretezési mód:",
50+
"None": "Nincs",
51+
"Local scaling": "Helyi méretezés",
52+
"Remote resizing": "Távoli átméretezés",
53+
"Advanced": "Speciális",
54+
"Quality:": "Minőség:",
55+
"Compression level:": "Tömörítési szint:",
56+
"Repeater ID:": "Ismétlő azonosító:",
57+
"WebSocket": "WebSocket",
58+
"Encrypt": "Titkosítás",
59+
"Host:": "Hoszt:",
60+
"Port:": "Port:",
61+
"Path:": "Útvonal:",
62+
"Automatic reconnect": "Automatikus újracsatlakozás",
63+
"Reconnect delay (ms):": "Újracsatlakozás késleltetése (ms):",
64+
"Show dot when no cursor": "Kurzor hiányában pont mutatása",
65+
"Logging:": "Naplózás:",
66+
"Version:": "Verzió:",
67+
"Disconnect": "Kapcsolat bontása",
68+
"Connect": "Csatlakozás",
69+
"Server identity": "Szerver azonosító",
70+
"The server has provided the following identifying information:": "A szerver a következő azonosító információt adta meg:",
71+
"Fingerprint:": "Ujjlenyomat:",
72+
"Please verify that the information is correct and press \"Approve\". Otherwise press \"Reject\".": "Ellenőrizze, hogy az információ helyes-e és nyomja meg a \"Jóváhagyás\" gombot. Ellenkező esetben nyomja meg az \"Elutasítás\" gombot.",
73+
"Approve": "Jóváhagyás",
74+
"Reject": "Elutasítás",
75+
"Credentials": "Hitelesítő adatok",
76+
"Username:": "Felhasználónév:",
77+
"Password:": "Jelszó:",
78+
"Send credentials": "Hitelesítő adatok küldése",
79+
"Cancel": "Mégse"
80+
}

app/locale/uk.json

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
{
2+
"Running without HTTPS is not recommended, crashes or other issues are likely.": "Робота без HTTPS не рекомендується, ймовірні збої чи інші проблеми.",
3+
"Connecting...": "З'єднання...",
4+
"Disconnecting...": "Від'єднання...",
5+
"Reconnecting...": "Перез'єднання...",
6+
"Internal error": "Внутрішня помилка",
7+
"Failed to connect to server: ": "Не вдалося з'єднатися з сервером: ",
8+
"Connected (encrypted) to ": "З'єднано (з шифруванням) з ",
9+
"Connected (unencrypted) to ": "З'єднано (без шифрування) з ",
10+
"Something went wrong, connection is closed": "Щось пішло не так, з'єднання закрито",
11+
"Failed to connect to server": "Не вдалося з'єднатися з сервером",
12+
"Disconnected": "Від'єднано",
13+
"New connection has been rejected with reason: ": "Нове з'єднання відхилено. Причина: ",
14+
"New connection has been rejected": "Нове з'єднання відхилено",
15+
"Are you sure you want to disconnect the session?": "Точно від'єднати сеанс?",
16+
"Credentials are required": "Треба особові дані",
17+
"noVNC encountered an error:": "Помилка noVNC:",
18+
"Hide/Show the control bar": "Сховати/показати панель керування",
19+
"Drag": "Посунути",
20+
"Move/Drag viewport": "Змістити область огляду",
21+
"Keyboard": "Клавіатура",
22+
"Show keyboard": "Показати клавіатуру",
23+
"Extra keys": "Додаткові клавіші",
24+
"Show extra keys": "Показати додаткові клавіші",
25+
"Ctrl": "Ctrl",
26+
"Toggle Ctrl": "Затиснути Ctrl",
27+
"Alt": "Alt",
28+
"Toggle Alt": "Затиснути Alt",
29+
"Toggle Windows": "Затиснути Windows",
30+
"Windows": "Windows",
31+
"Send Tab": "Натиснути Tab",
32+
"Tab": "Tab",
33+
"Esc": "Esc",
34+
"Send Escape": "Натиснути Escape",
35+
"Ctrl+Alt+Del": "Ctrl+Alt+Del",
36+
"Send Ctrl-Alt-Del": "Натиснути Ctrl+Alt+Del",
37+
"Shutdown/Reboot": "Вимкнути/перезавантажити",
38+
"Shutdown/Reboot...": "Вимкнути/перезавантажити...",
39+
"Power": "Живлення",
40+
"Shutdown": "Вимкнути",
41+
"Reboot": "Перезавантажити",
42+
"Reset": "Скинути",
43+
"Clipboard": "Буфер обміну",
44+
"Edit clipboard content in the textarea below.": "Редагуйте вміст буфера обміну в текстовій зоні внизу.",
45+
"Full screen": "Повний екран",
46+
"Settings": "Параметри",
47+
"Shared mode": "Спільний режим",
48+
"View only": "Лише перегляд",
49+
"Clip to window": "До розмірів вікна",
50+
"Scaling mode:": "Режим масштабування:",
51+
"None": "Вимкнено",
52+
"Local scaling": "Локальне масштабування",
53+
"Remote resizing": "Віддалене масштабування",
54+
"Advanced": "Додатково",
55+
"Quality:": "Якість:",
56+
"Compression level:": "Рівень стиснення:",
57+
"Repeater ID:": "Ідентифікатор репітера:",
58+
"WebSocket": "WebSocket",
59+
"Encrypt": "Шифрування",
60+
"Host:": "Сервер:",
61+
"Port:": "Порт:",
62+
"Path:": "Шлях:",
63+
"Automatic reconnect": "Автоматичне перез'єднання",
64+
"Reconnect delay (ms):": "Затримка перез'єднання (мс):",
65+
"Show dot when no cursor": "Показувати крапку, коли нема курсора",
66+
"Logging:": "Журнал:",
67+
"Version:": "Версія:",
68+
"Disconnect": "Від'єднати",
69+
"Connect": "З'єднати",
70+
"Server identity": "Ідентифікація сервера",
71+
"The server has provided the following identifying information:": "Сервер надає такі ідентифікаційні дані:",
72+
"Fingerprint:": "Відбиток:",
73+
"Please verify that the information is correct and press \"Approve\". Otherwise press \"Reject\".": "Перевірте, чи дані коректні, й натисніть «Схвалити». Інакше натисніть «Відхилити».",
74+
"Approve": "Схвалити",
75+
"Reject": "Відхилити",
76+
"Credentials": "Особові дані",
77+
"Username:": "Користувацьке ім'я:",
78+
"Password:": "Пароль:",
79+
"Send credentials": "Надіслати особові дані",
80+
"Cancel": "Скасувати"
81+
}

app/ui.js

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ import KeyTable from "../core/input/keysym.js";
1616
import keysyms from "../core/input/keysymdef.js";
1717
import Keyboard from "../core/input/keyboard.js";
1818
import RFB from "../core/rfb.js";
19+
import WakeLockManager from './wakelock.js';
1920
import * as WebUtil from "./webutil.js";
2021

2122
const PAGE_TITLE = "noVNC";
2223

23-
const LINGUAS = ["cs", "de", "el", "es", "fr", "hr", "it", "ja", "ko", "nl", "pl", "pt_BR", "ru", "sv", "tr", "zh_CN", "zh_TW"];
24+
const LINGUAS = ["cs", "de", "el", "es", "fr", "hr", "hu", "it", "ja", "ko", "nl", "pl", "pt_BR", "ru", "sv", "tr", "uk", "zh_CN", "zh_TW"];
2425

2526
const UI = {
2627

@@ -47,6 +48,8 @@ const UI = {
4748
reconnectPassword: null,
4849
disconnectStatusTimeout: null,
4950

51+
wakeLockManager: new WakeLockManager(),
52+
5053
async start(options={}) {
5154
UI.customSettings = options.settings || {};
5255
if (UI.customSettings.defaults === undefined) {
@@ -136,11 +139,9 @@ const UI = {
136139

137140
let autoconnect = UI.getSetting('autoconnect');
138141
if (autoconnect === 'true' || autoconnect == '1') {
139-
autoconnect = true;
140142
UI.inhibitReconnect = false;
141143
UI.connect();
142144
} else {
143-
autoconnect = false;
144145
// Show the connect panel on first load unless autoconnecting
145146
UI.openConnectPanel();
146147
}
@@ -191,6 +192,7 @@ const UI = {
191192
UI.initSetting('repeaterID', '');
192193
UI.initSetting('reconnect', true);
193194
UI.initSetting('reconnect_delay', 2000);
195+
UI.initSetting('keep_device_awake', false);
194196
},
195197
// Adds a link to the label elements on the corresponding input elements
196198
setupSettingLabels() {
@@ -375,6 +377,8 @@ const UI = {
375377
UI.addSettingChangeHandler('view_only', UI.updateViewOnly);
376378
UI.addSettingChangeHandler('show_dot');
377379
UI.addSettingChangeHandler('show_dot', UI.updateShowDotCursor);
380+
UI.addSettingChangeHandler('keep_device_awake');
381+
UI.addSettingChangeHandler('keep_device_awake', UI.updateRequestWakelock);
378382
UI.addSettingChangeHandler('host');
379383
UI.addSettingChangeHandler('port');
380384
UI.addSettingChangeHandler('path');
@@ -1128,6 +1132,10 @@ const UI = {
11281132
url.protocol = (window.location.protocol === "https:") ? 'wss:' : 'ws:';
11291133
}
11301134

1135+
if (UI.getSetting('keep_device_awake')) {
1136+
UI.wakeLockManager.acquire();
1137+
}
1138+
11311139
try {
11321140
UI.rfb = new RFB(document.getElementById('noVNC_container'),
11331141
url.href,
@@ -1214,6 +1222,8 @@ const UI = {
12141222
UI.showStatus(msg);
12151223
UI.updateVisualState('connected');
12161224

1225+
UI.updateBeforeUnload();
1226+
12171227
// Do this last because it can only be used on rendered elements
12181228
UI.rfb.focus();
12191229
},
@@ -1228,6 +1238,7 @@ const UI = {
12281238
UI.connected = false;
12291239

12301240
UI.rfb = undefined;
1241+
UI.wakeLockManager.release();
12311242

12321243
if (!e.detail.clean) {
12331244
UI.updateVisualState('disconnected');
@@ -1254,14 +1265,16 @@ const UI = {
12541265
UI.showStatus(_("Disconnected"), 'normal');
12551266
}
12561267

1268+
UI.updateBeforeUnload();
1269+
12571270
document.title = PAGE_TITLE;
12581271

12591272
UI.openControlbar();
12601273
UI.openConnectPanel();
12611274
},
12621275

12631276
securityFailed(e) {
1264-
let msg = "";
1277+
let msg;
12651278
// On security failures we might get a string with a reason
12661279
// directly from the server. Note that we can't control if
12671280
// this string is translated or not.
@@ -1274,6 +1287,24 @@ const UI = {
12741287
UI.showStatus(msg, 'error');
12751288
},
12761289

1290+
handleBeforeUnload(e) {
1291+
// Trigger a "Leave site?" warning prompt before closing the
1292+
// page. Modern browsers (Oct 2025) accept either (or both)
1293+
// preventDefault() or a nonempty returnValue, though the latter is
1294+
// considered legacy. The custom string is ignored by modern browsers,
1295+
// which display a native message, but older browsers will show it.
1296+
e.preventDefault();
1297+
e.returnValue = _("Are you sure you want to disconnect the session?");
1298+
},
1299+
1300+
updateBeforeUnload() {
1301+
// Remove first to avoid adding duplicates
1302+
window.removeEventListener("beforeunload", UI.handleBeforeUnload);
1303+
if (!UI.rfb?.viewOnly && UI.connected) {
1304+
window.addEventListener("beforeunload", UI.handleBeforeUnload);
1305+
}
1306+
},
1307+
12771308
/* ------^-------
12781309
* /CONNECTION
12791310
* ==============
@@ -1800,6 +1831,8 @@ const UI = {
18001831
if (!UI.rfb) return;
18011832
UI.rfb.viewOnly = UI.getSetting('view_only');
18021833

1834+
UI.updateBeforeUnload();
1835+
18031836
// Hide input related buttons in view only mode
18041837
if (UI.rfb.viewOnly) {
18051838
document.getElementById('noVNC_keyboard_button')
@@ -1858,6 +1891,16 @@ const UI = {
18581891
document.title = e.detail.name + " - " + PAGE_TITLE;
18591892
},
18601893

1894+
updateRequestWakelock() {
1895+
if (!UI.rfb) return;
1896+
if (UI.getSetting('keep_device_awake')) {
1897+
UI.wakeLockManager.acquire();
1898+
} else {
1899+
UI.wakeLockManager.release();
1900+
}
1901+
},
1902+
1903+
18611904
bell(e) {
18621905
if (UI.getSetting('bell') === 'on') {
18631906
const promise = document.getElementById('noVNC_bell').play();

0 commit comments

Comments
 (0)