chore: fix UI Mode on Codespaces (#23549)

This commit is contained in:
Max Schmitt 2023-06-06 20:09:39 +02:00 committed by GitHub
parent 6351630af2
commit ce2f902c1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -644,7 +644,7 @@ const callbacks = new Map<number, { resolve: (arg: any) => void, reject: (arg: E
const initWebSocket = async (onClose: () => void) => {
const guid = new URLSearchParams(window.location.search).get('ws');
const ws = new WebSocket(`ws://${window.location.hostname}:${window.location.port}/${guid}`);
const ws = new WebSocket(`${window.location.protocol === 'https:' ? 'wss' : 'ws'}://${window.location.hostname}:${window.location.port}/${guid}`);
await new Promise(f => ws.addEventListener('open', f));
ws.addEventListener('close', onClose);
ws.addEventListener('message', event => {