chore: fix UI Mode on Codespaces (#23549)
This commit is contained in:
parent
6351630af2
commit
ce2f902c1f
|
|
@ -644,7 +644,7 @@ const callbacks = new Map<number, { resolve: (arg: any) => void, reject: (arg: E
|
||||||
|
|
||||||
const initWebSocket = async (onClose: () => void) => {
|
const initWebSocket = async (onClose: () => void) => {
|
||||||
const guid = new URLSearchParams(window.location.search).get('ws');
|
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));
|
await new Promise(f => ws.addEventListener('open', f));
|
||||||
ws.addEventListener('close', onClose);
|
ws.addEventListener('close', onClose);
|
||||||
ws.addEventListener('message', event => {
|
ws.addEventListener('message', event => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue