mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-08-02 03:16:42 +02:00
Refactor
This commit is contained in:
@@ -67,4 +67,4 @@ export namespace BxEvent {
|
||||
}
|
||||
}
|
||||
|
||||
(window as any).BxEvent = BxEvent;
|
||||
window.BxEvent = BxEvent;
|
||||
|
@@ -16,4 +16,4 @@ export class BxLogger {
|
||||
}
|
||||
}
|
||||
|
||||
(window as any).BxLogger = BxLogger;
|
||||
window.BxLogger = BxLogger;
|
||||
|
@@ -2,8 +2,8 @@ import { BxEvent } from "@utils/bx-event";
|
||||
import { LoadingScreen } from "@modules/loading-screen";
|
||||
import { RemotePlayManager } from "@/modules/remote-play-manager";
|
||||
import { HeaderSection } from "@/modules/ui/header";
|
||||
import { NavigationDialogManager } from "@/modules/ui/dialog/navigation-dialog";
|
||||
import { EventBus } from "./event-bus";
|
||||
import { NavigationDialogManager } from "@/modules/ui/dialog/navigation-dialog";
|
||||
|
||||
export function patchHistoryMethod(type: 'pushState' | 'replaceState') {
|
||||
const orig = window.history[type];
|
||||
@@ -27,12 +27,6 @@ export function onHistoryChanged(e: PopStateEvent) {
|
||||
|
||||
window.setTimeout(RemotePlayManager.detect, 10);
|
||||
|
||||
// Hide Global settings
|
||||
const $settings = document.querySelector('.bx-settings-container');
|
||||
if ($settings) {
|
||||
$settings.classList.add('bx-gone');
|
||||
}
|
||||
|
||||
// Hide Navigation dialog
|
||||
NavigationDialogManager.getInstance().hide();
|
||||
|
||||
|
@@ -201,8 +201,8 @@ export function patchMeControl() {
|
||||
},
|
||||
};
|
||||
|
||||
(window as any).MSA = new Proxy(MSA, MsaHandler);
|
||||
(window as any).MeControl = new Proxy(MeControl, MeControlHandler);
|
||||
window.MSA = new Proxy(MSA, MsaHandler);
|
||||
window.MeControl = new Proxy(MeControl, MeControlHandler);
|
||||
}
|
||||
|
||||
|
||||
@@ -210,7 +210,7 @@ export function patchMeControl() {
|
||||
* Disable Adobe Audience Manager (AAM)
|
||||
*/
|
||||
export function disableAdobeAudienceManager() {
|
||||
(window as any).adobe = Object.freeze({});
|
||||
window.adobe = Object.freeze({});
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -189,7 +189,7 @@ export function interceptHttpRequests() {
|
||||
'2c06dea3f26c40c69b8456d319791fd0@o427368.ingest.sentry.io',
|
||||
];
|
||||
|
||||
(window as any).BX_FETCH = window.fetch = async (request: RequestInfo | URL, init?: RequestInit): Promise<Response> => {
|
||||
window.BX_FETCH = window.fetch = async (request: RequestInfo | URL, init?: RequestInit): Promise<Response> => {
|
||||
let url = (typeof request === 'string') ? request : (request as Request).url;
|
||||
|
||||
// Check blocked URLs
|
||||
|
@@ -10,7 +10,7 @@ type UserAgentConfig = {
|
||||
const SMART_TV_UNIQUE_ID = 'FC4A1DA2-711C-4E9C-BC7F-047AF8A672EA';
|
||||
|
||||
let CHROMIUM_VERSION = '125.0.0.0';
|
||||
if (!!(window as any).chrome || window.navigator.userAgent.includes('Chrome')) {
|
||||
if (!!window.chrome || window.navigator.userAgent.includes('Chrome')) {
|
||||
// Get Chromium version in the original User-Agent value
|
||||
const match = window.navigator.userAgent.match(/\s(?:Chrome|Edg)\/([\d\.]+)/);
|
||||
if (match) {
|
||||
|
Reference in New Issue
Block a user