diff options
author | Pierre Ossman <ossman@cendio.se> | 2022-05-12 15:46:59 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2022-05-12 15:48:46 +0200 |
commit | cdfb33665195eb9a73fb00feb6ebaccd1068cd50 (patch) | |
tree | 37f131d6f4b2b4058cfc5fb3eacdd34b7687bb00 /app/ui.js | |
parent | 658e4157969b2f0b8da7d37523b1ca88441f9e20 (diff) | |
download | novnc-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.js | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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) { |