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:
@@ -2,7 +2,7 @@
|
||||
* Central overlay state machine: coordinates room/game lifecycle and registered UI components.
|
||||
*/
|
||||
|
||||
export const OVERRIDE_MODES = Object.freeze({
|
||||
const OVERRIDE_MODES = Object.freeze({
|
||||
AUTO: 'auto',
|
||||
FORCE_SHOW: 'force_show',
|
||||
FORCE_HIDE: 'force_hide',
|
||||
@@ -34,7 +34,7 @@ function shallowClone(obj) {
|
||||
* @property {() => object} getStatus
|
||||
*/
|
||||
|
||||
export class OverlayManager {
|
||||
class OverlayManager {
|
||||
/** @type {OverlayState} */
|
||||
#state = 'idle';
|
||||
|
||||
@@ -414,3 +414,7 @@ export class OverlayManager {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
window.OBS = window.OBS || {};
|
||||
window.OBS.OVERRIDE_MODES = OVERRIDE_MODES;
|
||||
window.OBS.OverlayManager = OverlayManager;
|
||||
|
||||
Reference in New Issue
Block a user