summaryrefslogtreecommitdiff
path: root/app/ui.js
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2022-05-12 15:46:59 +0200
committerPierre Ossman <ossman@cendio.se>2022-05-12 15:48:46 +0200
commitcdfb33665195eb9a73fb00feb6ebaccd1068cd50 (patch)
tree37f131d6f4b2b4058cfc5fb3eacdd34b7687bb00 /app/ui.js
parent658e4157969b2f0b8da7d37523b1ca88441f9e20 (diff)
downloadnovnc-cdfb33665195eb9a73fb00feb6ebaccd1068cd50.tar.gz
Add warnings about insecure context
Most (all?) new APIs will require a "secure context", which generally means served over TLS. We can expect crashes because of missing functions if this requirement isn't fulfilled, so try to warn the user.
Diffstat (limited to 'app/ui.js')
-rw-r--r--app/ui.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/ui.js b/app/ui.js
index e1c5892..95f938d 100644
--- a/app/ui.js
+++ b/app/ui.js
@@ -61,6 +61,14 @@ const UI = {
// Translate the DOM
l10n.translateDOM();
+ // We rely on modern APIs which might not be available in an
+ // insecure context
+ if (!window.isSecureContext) {
+ // FIXME: This gets hidden when connecting
+ UI.showStatus(_("HTTPS is required for full functionality"), 'error');
+ }
+
+ // Try to fetch version number
fetch('./package.json')
.then((response) => {
if (!response.ok) {