From 028313eb27736af3db3ef868023b214821f6ba3e Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Mon, 1 Sep 2025 20:15:14 -0600 Subject: [PATCH] Support WS connections on older browsers. --- frontend/src/utils/awaitable-websocket.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/utils/awaitable-websocket.js b/frontend/src/utils/awaitable-websocket.js index befc237..ad83a81 100644 --- a/frontend/src/utils/awaitable-websocket.js +++ b/frontend/src/utils/awaitable-websocket.js @@ -74,10 +74,10 @@ class AwaitableWebSocket extends WebSocket { } } -// Construct an async WebSocket with await aWebSocket(url) +// Construct an async WebSocket with await aWebSocket(url) - supports relative URLs even with old browsers that don't export default function aWebSocket(url, options = {}) { const { protocols, binaryType } = options return new Promise((resolve, reject) => { - new AwaitableWebSocket(resolve, reject, url, protocols, binaryType) + new AwaitableWebSocket(resolve, reject, new URL(url, location.href), protocols, binaryType) }) }