Skip to content

Commit

Permalink
offscreen now requires https with Chrome
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Nov 28, 2023
1 parent 7a36b1b commit 52d11ae
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion html5/js/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class XpraClient {
this.PING_FREQUENCY = 5000;
this.INFO_FREQUENCY = 1000;
this.uuid = Utilities.getHexUUID();
this.offscreen_api = DECODE_WORKER && XpraOffscreenWorker.isAvailable();
this.offscreen_api = false;
this.try_gpu = TRY_GPU_TRIGGER;

this.init_encodings();
Expand Down Expand Up @@ -542,6 +542,7 @@ class XpraClient {
this._do_connect(false);
return;
}
this.offscreen_api = DECODE_WORKER && XpraOffscreenWorker.isAvailable(this.ssl);
this.clog("we have webworker support");
// spawn worker that checks for a websocket
const worker = new Worker("js/lib/wsworker_check.js");
Expand Down
10 changes: 9 additions & 1 deletion html5/js/OffscreenDecodeWorkerHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,24 @@ const XpraOffscreenWorker = {
return false;
},

isAvailable() {
isAvailable(ssl) {
if (Utilities.isSafari() && !this.isSafariVersionSupported()) {
console.log("offscreen canvas is not supported with this version of Safari");
return false;
}

if (Utilities.isWebkit() && !Utilities.isChrome()) {
console.log("offscreen canvas is not supported with this webkit browser");
return false;
}

if (Utilities.isFirefox() && this.isFirefoxVersionSupported()) {
console.log("offscreen canvas is not supported with this version of Firefox");
return false;
}

if (Utilities.isChrome() && !ssl) {
console.log("offscreen canvas requires https with Chrome");
return false;
}

Expand Down

0 comments on commit 52d11ae

Please sign in to comment.