fix: convert ES modules to classic scripts for file:// compatibility
Browsers block ES module imports over the file:// protocol due to CORS. Users opening the overlay by double-clicking the HTML file saw all JS fail to load. Replace import/export with a window.OBS global namespace and classic <script> tags so the overlay works without a local server. Made-with: Cursor
This commit is contained in:
@@ -10,7 +10,7 @@ const INITIAL_RECONNECT_DELAY_MS = 1_000;
|
||||
* @typedef {'connecting'|'connected'|'disconnected'|'error'} WsConnectionState
|
||||
*/
|
||||
|
||||
export class WebSocketClient {
|
||||
class WebSocketClient {
|
||||
constructor(options = {}) {
|
||||
const {
|
||||
onStatusChange = () => {},
|
||||
@@ -466,3 +466,6 @@ export class WebSocketClient {
|
||||
}, delay);
|
||||
}
|
||||
}
|
||||
|
||||
window.OBS = window.OBS || {};
|
||||
window.OBS.WebSocketClient = WebSocketClient;
|
||||
|
||||
Reference in New Issue
Block a user