Init UserAgent before STATES

This commit is contained in:
redphx 2024-05-11 09:39:50 +07:00
parent 011b75057a
commit 8bee5b2073
2 changed files with 5 additions and 3 deletions

View File

@ -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();

View File

@ -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: {},