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.
This commit is contained in:
@@ -79,6 +79,12 @@ export default class RFB extends EventTargetMixin {
|
||||
throw new Error("Must specify URL, WebSocket or RTCDataChannel");
|
||||
}
|
||||
|
||||
// We rely on modern APIs which might not be available in an
|
||||
// insecure context
|
||||
if (!window.isSecureContext) {
|
||||
Log.Error("noVNC requires a secure context (TLS). Expect crashes!");
|
||||
}
|
||||
|
||||
super();
|
||||
|
||||
this._target = target;
|
||||
|
||||
Reference in New Issue
Block a user