diff --git a/src/index.ts b/src/index.ts index 7fa6fd4..d0de5ea 100644 --- a/src/index.ts +++ b/src/index.ts @@ -28,7 +28,7 @@ import { STATES } from "@utils/global"; import { injectStreamMenuButtons } from "@modules/stream/stream-ui"; import { BxLogger } from "@utils/bx-logger"; import { GameBar } from "./modules/game-bar/game-bar"; -import { UserAgent } from "./utils/user-agent"; + // Handle login page if (window.location.pathname.includes('/auth/msa')) { @@ -188,8 +188,6 @@ window.addEventListener(BxEvent.STREAM_STOPPED, e => { function main() { - UserAgent.init(); - // Monkey patches patchRtcPeerConnection(); patchRtcCodecs(); diff --git a/src/utils/global.ts b/src/utils/global.ts index 4614e6b..c7d3303 100644 --- a/src/utils/global.ts +++ b/src/utils/global.ts @@ -1,8 +1,12 @@ +import { UserAgent } from "./user-agent"; + export const SCRIPT_VERSION = Bun.env.SCRIPT_VERSION; export const SCRIPT_HOME = 'https://github.com/redphx/better-xcloud'; export const AppInterface = window.AppInterface; +UserAgent.init(); + export const STATES: BxStates = { isPlaying: false, appContext: {},