From 22603043131394f0e0db0d37e99bb77d3061fc32 Mon Sep 17 00:00:00 2001 From: redphx <96280+redphx@users.noreply.github.com> Date: Sun, 21 Sep 2025 15:35:07 +0700 Subject: [PATCH] fix: remove "productDetailPageBeforeLoad" patch --- dist/better-xcloud.pretty.user.js | 15 ++++----------- dist/better-xcloud.user.js | 11 +++++------ src/modules/patcher/patcher.ts | 20 ++++---------------- 3 files changed, 13 insertions(+), 33 deletions(-) diff --git a/dist/better-xcloud.pretty.user.js b/dist/better-xcloud.pretty.user.js index 718fac3..520fbe3 100644 --- a/dist/better-xcloud.pretty.user.js +++ b/dist/better-xcloud.pretty.user.js @@ -5625,9 +5625,6 @@ if (this.baseStorageKey in window.BX_EXPOSED.overrideSettings) { homePageBeforeLoad(str) { return PatcherUtils.patchBeforePageLoad(str, "home"); }, - productDetailPageBeforeLoad(str) { - return PatcherUtils.patchBeforePageLoad(str, "product-detail"); - }, streamPageBeforeLoad(str) { return PatcherUtils.patchBeforePageLoad(str, "stream"); }, @@ -5786,9 +5783,9 @@ try { "homePageBeforeLoad", "patchCustomInputIcon", "gameCardCustomIcons", - "productDetailPageBeforeLoad", "enableTvRoutes", "overrideStorageGetSettings", + "detectProductDetailPage", getGlobalPref("ui.layout") !== "default" && "websiteLayout", getGlobalPref("game.fortnite.forceConsole") && "forceFortniteConsole", ...STATES.userAgent.capabilities.touch ? [ @@ -5850,15 +5847,12 @@ try { "patchMouseAndKeyboardEnabled", "disableNativeRequestPointerLock" ] : [] -]), PRODUCT_DETAIL_PAGE_PATCH_ORDERS = PatcherUtils.filterPatches([ - "detectProductDetailPage" -]), ALL_PATCHES = [...PATCH_ORDERS, ...HOME_PAGE_PATCH_ORDERS, ...STREAM_PAGE_PATCH_ORDERS, ...PRODUCT_DETAIL_PAGE_PATCH_ORDERS]; +]), ALL_PATCHES = [...PATCH_ORDERS, ...HOME_PAGE_PATCH_ORDERS, ...STREAM_PAGE_PATCH_ORDERS]; class Patcher { static remainingPatches = { home: HOME_PAGE_PATCH_ORDERS, stream: STREAM_PAGE_PATCH_ORDERS, - "remote-play-stream": STREAM_PAGE_PATCH_ORDERS, - "product-detail": PRODUCT_DETAIL_PAGE_PATCH_ORDERS + "remote-play-stream": STREAM_PAGE_PATCH_ORDERS }; static patchPage(page) { let remaining = Patcher.remainingPatches[page]; @@ -5925,9 +5919,8 @@ class PatcherCache { let pathName = window.location.pathname; if (pathName.includes("/play/consoles/launch/")) Patcher.patchPage("remote-play-stream"); else if (pathName.includes("/play/launch/")) Patcher.patchPage("stream"); - else if (pathName.includes("/play/games/")) Patcher.patchPage("product-detail"); else if (pathName.endsWith("/play") || pathName.endsWith("/play/")) Patcher.patchPage("home"); - PATCH_ORDERS = this.cleanupPatches(PATCH_ORDERS), STREAM_PAGE_PATCH_ORDERS = this.cleanupPatches(STREAM_PAGE_PATCH_ORDERS), PRODUCT_DETAIL_PAGE_PATCH_ORDERS = this.cleanupPatches(PRODUCT_DETAIL_PAGE_PATCH_ORDERS), BxLogger.info(LOG_TAG2, "PATCH_ORDERS", PATCH_ORDERS.slice(0)); + PATCH_ORDERS = this.cleanupPatches(PATCH_ORDERS), STREAM_PAGE_PATCH_ORDERS = this.cleanupPatches(STREAM_PAGE_PATCH_ORDERS), BxLogger.info(LOG_TAG2, "PATCH_ORDERS", PATCH_ORDERS.slice(0)); } getSignature() { let scriptVersion = SCRIPT_VERSION, patches = JSON.stringify(ALL_PATCHES), clientHash = "", $link = document.querySelector('link[data-chunk="client"][as="script"][href*="/client."]'); diff --git a/dist/better-xcloud.user.js b/dist/better-xcloud.user.js index 88e21df..a619ab0 100755 --- a/dist/better-xcloud.user.js +++ b/dist/better-xcloud.user.js @@ -190,19 +190,18 @@ ${expose_stream_session_default} true` + text;return str = str.replace(text, newCode), str;},skipFeedbackDialog(str) {let index = str.indexOf("}shouldTransitionToFeedback(");if (index >= 0 && (index = PatcherUtils.indexOf(str, "}){", index, 200, !0)), index < 0) return !1;return str = PatcherUtils.insertAt(str, index, "return !1;"), str;},enableNativeMkb(str) {let index = str.indexOf(".mouseSupported&&");if (index < 0) return !1;let varName = str.charAt(index - 1), text = `${varName}.mouseSupported&&${varName}.keyboardSupported&&${varName}.fullscreenSupported;`;if (!str.includes(text)) return !1;return str = str.replace(text, text + "return true;"), str;},patchMouseAndKeyboardEnabled(str) {let text = "get mouseAndKeyboardEnabled(){";if (!str.includes(text)) return !1;return str = str.replace(text, text + "return true;"), str;},exposeInputChannel(str) {let text = '()(this,"flushData",(';if (!str.includes(text)) return !1;return str = str.replace(text, '()(window.BX_EXPOSED.inputChannel = this, "flushData", ('), str;},disableNativeRequestPointerLock(str) {let text = "async requestPointerLock(){";if (!str.includes(text)) return !1;return str = str.replace(text, text + "return;"), str;},patchRequestInfoCrash(str) {let text = 'if(!e)throw new Error("RequestInfo.origin is falsy");';if (!str.includes(text)) return !1;return str = str.replace(text, 'if (!e) e = "https://www.xbox.com";'), str;},exposeDialogRoutes(str) {let index = str.indexOf("return{goBack:function(){"), firstIndex = index;if (index >= 0 && (index = PatcherUtils.indexOf(str, "getIsAnyDialogOpen", index, 2000)), index >= 0 && (index = PatcherUtils.indexOf(str, "return ", index, 300)), index < 0) return !1;let endBracketIndex = PatcherUtils.indexOf(str, "}", index, 50), oldCode = str.substring(index, endBracketIndex), newCode = str.substring(index, endBracketIndex).replace("return", "const result=") + ";";return newCode += 'window.BxEventBus.Script.emit(result ? "dialog.shown" : "dialog.dismissed", {});', newCode += "return result;", str = PatcherUtils.replaceWith(str, index, oldCode, newCode), str = PatcherUtils.insertAt(str, firstIndex + 6, " window.BX_EXPOSED.dialogRoutes = "), str;},enableTvRoutes(str) {let index = str.indexOf(".LoginDeviceCode.path,");if (index < 0) return !1;let match = /render:.*?jsx\)\(([^,]+),/.exec(str.substring(index, index + 100));if (!match) return !1;let funcName = match[1];if (index = str.indexOf(`const ${funcName}=({children`), index > -1 && (index = PatcherUtils.indexOf(str, "return ", 300)), index > -1 && (index = PatcherUtils.indexOf(str, "?", 100)), index < 0) return !1;return str = str.substring(0, index) + "|| true" + str.substring(index), str;},ignoreNewsSection(str) {let index = str.indexOf('("CarouselRow"))');if (index > -1 && (index = PatcherUtils.lastIndexOf(str, "const ", index, 200)), index < 0) return !1;return str = PatcherUtils.insertAt(str, index, "return null;"), str;},ignorePlayWithFriendsSection(str) {let index = str.indexOf('location:"PlayWithFriendsRow",');if (index < 0) return !1;if (index = PatcherUtils.lastIndexOf(str, "=>", index, 50), index < 0) return !1;return str = PatcherUtils.replaceWith(str, index, "=>", "=> true ? null :"), str;},ignoreAllGamesSection(str) {let index = str.indexOf('className:"AllGamesRow-module__allGamesRowContainer');if (index > -1 && (index = PatcherUtils.indexOf(str, "grid:!0,", index, 1500)), index > -1 && (index = PatcherUtils.lastIndexOf(str, "(0,", index, 70)), index < 0) return !1;return str = PatcherUtils.insertAt(str, index, "true ? null :"), str;},ignoreByogSection(str) {let index = str.indexOf('"ShowcaseRow-module__container');if (index > -1 && (index = PatcherUtils.lastIndexOf(str, ")=>(", index, 200)), index < 0) return !1;return str = PatcherUtils.insertAt(str, index + 3, "null && "), str;},ignorePlayWithTouchSection(str) {let index = str.indexOf('("Play_With_Touch"),');if (index < 0) return !1;if (index = PatcherUtils.lastIndexOf(str, "const ", index, 30), index < 0) return !1;return str = PatcherUtils.insertAt(str, index, "return null;"), str;},ignoreSiglSections(str) {let index = str.indexOf("SiglRow requires either id");if (index >= 0 && (index = PatcherUtils.lastIndexOf(str, "})=>{", index, 300, !0)), index < 0) return !1;let params = PatcherUtils.findAndParseParams(str, PatcherUtils.lastIndexOf(str, "const", index, 1000), 1000);if (!params || !params.id) return !1;let PREF_HIDE_SECTIONS = getGlobalPref("ui.hideSections"), siglIds = [], sections = {"native-mkb": "8fa264dd-124f-4af3-97e8-596fcdf4b486","most-popular": "e7590b22-e299-44db-ae22-25c61405454c","leaving-soon": "393f05bf-e596-4ef6-9487-6d4fa0eab987","recently-added": "44a55037-770f-4bbf-bde5-a9fa27dba1da"};for (let section of PREF_HIDE_SECTIONS) {let galleryId = sections[section];galleryId && siglIds.push(galleryId);}let checkSyntax = siglIds.map((item2) => `${params.id} === "${item2}"`).join(" || "), newCode = `if (${params.id} && (${checkSyntax})) return null;`;return str = PatcherUtils.insertAt(str, index, newCode), str;},ignoreGenresSection(str) {let index = str.indexOf('="GenresRow"');if (index > -1 && (index = PatcherUtils.lastIndexOf(str, "{", index)), index < 0) return !1;return str = PatcherUtils.insertAt(str, index + 1, "return null;"), str;},overrideStorageGetSettings(str) {let text = "}getSetting(e){";if (!str.includes(text)) return !1;let newCode = ` // console.log('setting', this.baseStorageKey, e); if (this.baseStorageKey in window.BX_EXPOSED.overrideSettings) {const settings = window.BX_EXPOSED.overrideSettings[this.baseStorageKey];if (e in settings) {return settings[e];}} -`;return str = str.replace(text, text + newCode), str;},alwaysShowStreamHud(str) {let index = str.indexOf(",{onShowStreamMenu:");if (index < 0) return !1;if (index = str.indexOf("&&(0,", index - 100), index < 0) return !1;let commaIndex = str.indexOf(",", index - 10);return str = str.substring(0, commaIndex) + ",true" + str.substring(index), str;},patchSetCurrentFocus(str) {let index = str.indexOf(".setCurrentFocus=(");if (index < 0) return !1;return index = str.indexOf("{", index) + 1, str = PatcherUtils.insertAt(str, index, "e && BxEvent.dispatch(window, BxEvent.NAVIGATION_FOCUS_CHANGED, { element: e });"), str;},detectProductDetailPage(str) {let index = str.indexOf('{location:"ProductDetailPage",');if (index >= 0 && (index = PatcherUtils.lastIndexOf(str, "return", index, 200)), index < 0) return !1;return str = str.substring(0, index) + 'BxEvent.dispatch(window, BxEvent.XCLOUD_RENDERING_COMPONENT, { component: "product-detail" });' + str.substring(index), str;},detectBrowserRouterReady(str) {let index = str.indexOf("{history:this.history,");if (index >= 0 && (index = PatcherUtils.lastIndexOf(str, "return", index, 100)), index < 0) return !1;return str = PatcherUtils.insertAt(str, index, "window.BxEvent.dispatch(window, window.BxEvent.XCLOUD_ROUTER_HISTORY_READY, {history: this.history});"), str;},guideAchievementsDefaultLocked(str) {let index = str.indexOf("FilterButton-module__container");if (index >= 0 && (index = PatcherUtils.lastIndexOf(str, '"All"', index, 150)), index < 0) return !1;if (str = PatcherUtils.replaceWith(str, index, '"All"', '"Locked"'), index = str.indexOf('"Guide_Achievements_Unlocked_Empty","Guide_Achievements_Locked_Empty"'), index >= 0 && (index = PatcherUtils.indexOf(str, '"All"', index, 250)), index < 0) return !1;return str = PatcherUtils.replaceWith(str, index, '"All"', '"Locked"'), str;},disableTouchContextMenu(str) {let index = str.indexOf('.addEventListener("touchstart",');if (index >= 0 && (index = PatcherUtils.indexOf(str, '.addEventListener("touchend"', index, 200)), index >= 0 && (index = PatcherUtils.lastIndexOf(str, "return ", index, 50)), index < 0) return !1;return str = PatcherUtils.replaceWith(str, index, "return", "return () => {};"), str;},modifyPreloadedState(str) {let text = "=window.__PRELOADED_STATE__;";if (!str.includes(text)) return !1;return str = str.replace(text, "=window.BX_EXPOSED.modifyPreloadedState(window.__PRELOADED_STATE__);"), str;},homePageBeforeLoad(str) {return PatcherUtils.patchBeforePageLoad(str, "home");},productDetailPageBeforeLoad(str) {return PatcherUtils.patchBeforePageLoad(str, "product-detail");},streamPageBeforeLoad(str) {return PatcherUtils.patchBeforePageLoad(str, "stream");},remotePlayStreamPageBeforeLoad(str) {return PatcherUtils.patchBeforePageLoad(str, "remote-play-stream");},disableAbsoluteMouse(str) {let text = "sendAbsoluteMouseCapableMessage(e){";if (!str.includes(text)) return !1;return str = str.replace(text, text + "return;"), str;},changeNotificationsSubscription(str) {let text = ";buildSubscriptionQueryParamsForNotifications(", index = str.indexOf(text);if (index < 0) return !1;index += text.length;let subsVar = str[index];index = str.indexOf("{", index) + 1;let blockFeatures = getGlobalPref("block.features"), filters = [];if (blockFeatures.includes("notifications-invites")) filters.push("GameInvite", "PartyInvite");if (blockFeatures.includes("friends")) filters.push("Follower");if (blockFeatures.includes("notifications-achievements")) filters.push("AchievementUnlock");let newCode = ` +`;return str = str.replace(text, text + newCode), str;},alwaysShowStreamHud(str) {let index = str.indexOf(",{onShowStreamMenu:");if (index < 0) return !1;if (index = str.indexOf("&&(0,", index - 100), index < 0) return !1;let commaIndex = str.indexOf(",", index - 10);return str = str.substring(0, commaIndex) + ",true" + str.substring(index), str;},patchSetCurrentFocus(str) {let index = str.indexOf(".setCurrentFocus=(");if (index < 0) return !1;return index = str.indexOf("{", index) + 1, str = PatcherUtils.insertAt(str, index, "e && BxEvent.dispatch(window, BxEvent.NAVIGATION_FOCUS_CHANGED, { element: e });"), str;},detectProductDetailPage(str) {let index = str.indexOf('{location:"ProductDetailPage",');if (index >= 0 && (index = PatcherUtils.lastIndexOf(str, "return", index, 200)), index < 0) return !1;return str = str.substring(0, index) + 'BxEvent.dispatch(window, BxEvent.XCLOUD_RENDERING_COMPONENT, { component: "product-detail" });' + str.substring(index), str;},detectBrowserRouterReady(str) {let index = str.indexOf("{history:this.history,");if (index >= 0 && (index = PatcherUtils.lastIndexOf(str, "return", index, 100)), index < 0) return !1;return str = PatcherUtils.insertAt(str, index, "window.BxEvent.dispatch(window, window.BxEvent.XCLOUD_ROUTER_HISTORY_READY, {history: this.history});"), str;},guideAchievementsDefaultLocked(str) {let index = str.indexOf("FilterButton-module__container");if (index >= 0 && (index = PatcherUtils.lastIndexOf(str, '"All"', index, 150)), index < 0) return !1;if (str = PatcherUtils.replaceWith(str, index, '"All"', '"Locked"'), index = str.indexOf('"Guide_Achievements_Unlocked_Empty","Guide_Achievements_Locked_Empty"'), index >= 0 && (index = PatcherUtils.indexOf(str, '"All"', index, 250)), index < 0) return !1;return str = PatcherUtils.replaceWith(str, index, '"All"', '"Locked"'), str;},disableTouchContextMenu(str) {let index = str.indexOf('.addEventListener("touchstart",');if (index >= 0 && (index = PatcherUtils.indexOf(str, '.addEventListener("touchend"', index, 200)), index >= 0 && (index = PatcherUtils.lastIndexOf(str, "return ", index, 50)), index < 0) return !1;return str = PatcherUtils.replaceWith(str, index, "return", "return () => {};"), str;},modifyPreloadedState(str) {let text = "=window.__PRELOADED_STATE__;";if (!str.includes(text)) return !1;return str = str.replace(text, "=window.BX_EXPOSED.modifyPreloadedState(window.__PRELOADED_STATE__);"), str;},homePageBeforeLoad(str) {return PatcherUtils.patchBeforePageLoad(str, "home");},streamPageBeforeLoad(str) {return PatcherUtils.patchBeforePageLoad(str, "stream");},remotePlayStreamPageBeforeLoad(str) {return PatcherUtils.patchBeforePageLoad(str, "remote-play-stream");},disableAbsoluteMouse(str) {let text = "sendAbsoluteMouseCapableMessage(e){";if (!str.includes(text)) return !1;return str = str.replace(text, text + "return;"), str;},changeNotificationsSubscription(str) {let text = ";buildSubscriptionQueryParamsForNotifications(", index = str.indexOf(text);if (index < 0) return !1;index += text.length;let subsVar = str[index];index = str.indexOf("{", index) + 1;let blockFeatures = getGlobalPref("block.features"), filters = [];if (blockFeatures.includes("notifications-invites")) filters.push("GameInvite", "PartyInvite");if (blockFeatures.includes("friends")) filters.push("Follower");if (blockFeatures.includes("notifications-achievements")) filters.push("AchievementUnlock");let newCode = ` let subs = ${subsVar}; subs = subs.filter(val => !${JSON.stringify(filters)}.includes(val)); ${subsVar} = subs; `;return str = PatcherUtils.insertAt(str, index, newCode), str;},exposeReactCreateComponent(str) {let index = str.indexOf(".prototype.isReactComponent={}");if (index > -1 && (index = PatcherUtils.indexOf(str, ".createElement=", index)), index < 0) return !1;if (str = PatcherUtils.insertAt(str, index - 1, "window.BX_EXPOSED.reactCreateElement="), index = PatcherUtils.indexOf(str, ".useEffect=", index), index < 0) return !1;return str = PatcherUtils.insertAt(str, index - 1, "window.BX_EXPOSED.reactUseEffect="), str;},gameCardCustomIcons(str) {let initialIndex = str.indexOf("const{supportedInputIcons:");if (initialIndex < 0) return !1;let returnIndex = PatcherUtils.lastIndexOf(str, "return ", str.indexOf("SupportedInputsBadge"));if (returnIndex < 0) return !1;let productIdIndex = PatcherUtils.lastIndexOf(str, ",productId:", initialIndex, 300);if (productIdIndex < 0) return !1;let params = PatcherUtils.findAndParseParams(str, productIdIndex - 200, 400);if (!params || !params.productId) return !1;let productIdVar = params.productId, supportedInputIconsVar = PatcherUtils.getVariableNameAfter(str, PatcherUtils.indexOf(str, "supportedInputIcons:", initialIndex, 100, !0));if (!supportedInputIconsVar) return !1;let newCode = renderString(game_card_icons_default, {productId: productIdVar,supportedInputIcons: supportedInputIconsVar});return str = PatcherUtils.insertAt(str, returnIndex, newCode), str;},setImageQuality(str) {let index = str.indexOf("const{size:{width:");if (index > -1 && (index = PatcherUtils.indexOf(str, "=new URLSearchParams", index, 500)), index < 0) return !1;let paramVar = PatcherUtils.getVariableNameBefore(str, index);if (!paramVar) return !1;index = PatcherUtils.indexOf(str, "return", index, 200);let newCode = `${paramVar}.set('q', ${getGlobalPref("ui.imageQuality")});`;return str = PatcherUtils.insertAt(str, index, newCode), str;},setBackgroundImageQuality(str) {let index = str.indexOf("}?w=${");if (index > -1 && (index = PatcherUtils.indexOf(str, "}", index + 1, 10, !0)), index < 0) return !1;return str = PatcherUtils.insertAt(str, index, `&q=${getGlobalPref("ui.imageQuality")}`), str;},injectHeaderUseEffect(str) {let index = str.indexOf('className:"Header-module__header');if (index > -1 && (index = PatcherUtils.lastIndexOf(str, "return", index, 300)), index < 0) return !1;return PatcherUtils.injectUseEffect(str, index, "Script", "ui.header.rendered");},injectErrorPageUseEffect(str) {let index = str.indexOf('"PureErrorPage-module__container');if (index > -1 && (index = PatcherUtils.lastIndexOf(str, "})=>(0,", index, 200)), index < 0) return !1;return str = PatcherUtils.insertAt(str, index + 4, "{return "), str = PatcherUtils.injectUseEffect(str, index + 5, "Script", "ui.error.rendered"), str += "}", str;},injectStreamMenuUseEffect(str) {let index = str.indexOf('"StreamMenu-module__container');if (index > -1 && (index = PatcherUtils.lastIndexOf(str, "return", index, 200)), index < 0) return !1;return PatcherUtils.injectUseEffect(str, index, "Stream", "ui.streamMenu.rendered");},injectGuideHomeUseEffect(str) {let index = str.indexOf('"HomeLandingPage-module__authenticatedContentContainer');if (index > -1 && (index = PatcherUtils.lastIndexOf(str, "return", index, 200)), index < 0) return !1;return PatcherUtils.injectUseEffect(str, index, "Script", "ui.guideHome.rendered");},injectCreatePortal(str) {let index = str.indexOf(".createPortal=function");if (index > -1 && (index = PatcherUtils.indexOf(str, "{", index, 50, !0)), index < 0) return !1;return str = PatcherUtils.insertAt(str, index, create_portal_default), str;},injectAchievementsProgressUseEffect(str) {let index = str.indexOf('"AchievementsButton-module__progressBarContainer');if (index > -1 && (index = PatcherUtils.lastIndexOf(str, "return", index, 200)), index < 0) return !1;return PatcherUtils.injectUseEffect(str, index, "Script", "ui.guideAchievementProgress.rendered");},injectAchievementsDetailUseEffect(str) {let index = str.indexOf("GuideAchievementDetail.useParams()");if (index > -1 && (index = PatcherUtils.lastIndexOf(str, "const", index, 200)), index < 0) return !1;return PatcherUtils.injectUseEffect(str, index, "Script", "ui.guideAchievementDetail.rendered");},patchCustomInputIcon(str) {let index = str.indexOf('.MouseAndKeyboard="MouseAndKeyboard"');if (index < 0) return !1;let productIdMatch = /const (\w+)=(\w+)=>{/.exec(str.substring(index, index + 200));if (!productIdMatch) return !1;str = str.replace(productIdMatch[0], productIdMatch[0] + `const productId = ${productIdMatch[2]};`);let match = /(\w+)&&(\w+\.push\(\w+\.Touch\))/.exec(str);if (!match) return !1;if (str = str.replace(match[0], `(${match[1]} || window.BX_EXPOSED.hasCustomTouchControl(productId)) && ${match[2]}`), match = /(\w+)&&(\w+\.push\(\w+\.MouseAndKeyboard\))/.exec(str), match) str = str.replace(match[0], `(${match[1]} || window.BX_EXPOSED.hasCustomNativeMkb(productId)) && ${match[2]}`);return str;},patchStreamMetadata(str) {let index = str.indexOf("}onVideoFrame(");if (index >= 0 && (index = PatcherUtils.indexOf(str, "){", index, 30, !0)), index < 0) return !1;let code = ` try {const obj = arguments[0];const baseMs = obj.frameSubmittedTimeMs;const renderMs = obj.frameRenderedTimeMs - obj.frameDecodedTimeMs;obj.frameDecodedTimeMs = baseMs + ${1};obj.frameRenderedTimeMs = obj.frameDecodedTimeMs + renderMs;obj.expectedDisplayTime = obj.frameRenderedTimeMs;arguments[0] = obj;} catch (e) { alert(e) } -`;return str = PatcherUtils.insertAt(str, index, code), str;}}, PATCH_ORDERS = PatcherUtils.filterPatches([...AppInterface && getGlobalPref("nativeMkb.mode") === "on" ? ["enableNativeMkb","disableAbsoluteMouse"] : [],"exposeReactCreateComponent","injectCreatePortal","broadcastPollingMode",getGlobalPref("ui.gameCard.waitTime.show") && "patchSetCurrentFocus","patchGamepadPolling","modifyPreloadedState","detectBrowserRouterReady","exposeStreamSession","supportLocalCoOp","disableStreamGate","exposeDialogRoutes",...getGlobalPref("ui.imageQuality") < 90 ? ["setImageQuality"] : [],"patchRequestInfoCrash","injectErrorPageUseEffect","streamPageBeforeLoad","remotePlayStreamPageBeforeLoad","injectGuideHomeUseEffect","injectAchievementsProgressUseEffect","injectAchievementsDetailUseEffect","guideAchievementsDefaultLocked","injectHeaderUseEffect","homePageBeforeLoad","patchCustomInputIcon","gameCardCustomIcons","productDetailPageBeforeLoad","enableTvRoutes","overrideStorageGetSettings",getGlobalPref("ui.layout") !== "default" && "websiteLayout",getGlobalPref("game.fortnite.forceConsole") && "forceFortniteConsole",...STATES.userAgent.capabilities.touch ? ["disableTouchContextMenu"] : [],...getGlobalPref("block.tracking") ? ["disableAiTrack","blockWebRtcStatsCollector","disableIndexDbLogging","disableTelemetryProvider"] : [],...!getGlobalPref("block.features").includes("remote-play") ? ["remotePlayKeepAlive","remotePlayDisableAchievementToast",STATES.userAgent.capabilities.touch && "patchUpdateInputConfigurationAsync"] : [],...BX_FLAGS.EnableXcloudLogging ? ["enableConsoleLogging","enableXcloudLogger"] : [] +`;return str = PatcherUtils.insertAt(str, index, code), str;}}, PATCH_ORDERS = PatcherUtils.filterPatches([...AppInterface && getGlobalPref("nativeMkb.mode") === "on" ? ["enableNativeMkb","disableAbsoluteMouse"] : [],"exposeReactCreateComponent","injectCreatePortal","broadcastPollingMode",getGlobalPref("ui.gameCard.waitTime.show") && "patchSetCurrentFocus","patchGamepadPolling","modifyPreloadedState","detectBrowserRouterReady","exposeStreamSession","supportLocalCoOp","disableStreamGate","exposeDialogRoutes",...getGlobalPref("ui.imageQuality") < 90 ? ["setImageQuality"] : [],"patchRequestInfoCrash","injectErrorPageUseEffect","streamPageBeforeLoad","remotePlayStreamPageBeforeLoad","injectGuideHomeUseEffect","injectAchievementsProgressUseEffect","injectAchievementsDetailUseEffect","guideAchievementsDefaultLocked","injectHeaderUseEffect","homePageBeforeLoad","patchCustomInputIcon","gameCardCustomIcons","enableTvRoutes","overrideStorageGetSettings","detectProductDetailPage",getGlobalPref("ui.layout") !== "default" && "websiteLayout",getGlobalPref("game.fortnite.forceConsole") && "forceFortniteConsole",...STATES.userAgent.capabilities.touch ? ["disableTouchContextMenu"] : [],...getGlobalPref("block.tracking") ? ["disableAiTrack","blockWebRtcStatsCollector","disableIndexDbLogging","disableTelemetryProvider"] : [],...!getGlobalPref("block.features").includes("remote-play") ? ["remotePlayKeepAlive","remotePlayDisableAchievementToast",STATES.userAgent.capabilities.touch && "patchUpdateInputConfigurationAsync"] : [],...BX_FLAGS.EnableXcloudLogging ? ["enableConsoleLogging","enableXcloudLogger"] : [] ]), hideSections = getGlobalPref("ui.hideSections"), HOME_PAGE_PATCH_ORDERS = PatcherUtils.filterPatches([hideSections.includes("genres") && "ignoreGenresSection",hideSections.includes("byog") && "ignoreByogSection",STATES.browser.capabilities.touch && hideSections.includes("touch") && "ignorePlayWithTouchSection",getGlobalPref("ui.imageQuality") < 90 && "setBackgroundImageQuality",hideSections.some((value) => ["native-mkb", "most-popular"].includes(value)) && "ignoreSiglSections",hideSections.includes("news") && "ignoreNewsSection",(getGlobalPref("block.features").includes("friends") || hideSections.includes("friends")) && "ignorePlayWithFriendsSection",hideSections.includes("all-games") && "ignoreAllGamesSection",...blockSomeNotifications() ? ["changeNotificationsSubscription"] : [] ]), STREAM_PAGE_PATCH_ORDERS = PatcherUtils.filterPatches(["exposeInputChannel","patchXcloudTitleInfo","disableGamepadDisconnectedScreen","patchStreamHud","playVibration","alwaysShowStreamHud","injectStreamMenuUseEffect","patchStreamMetadata",getGlobalPref("audio.volume.booster.enabled") && !getGlobalPref("stream.video.combineAudio") && "patchAudioMediaStream",getGlobalPref("audio.volume.booster.enabled") && getGlobalPref("stream.video.combineAudio") && "patchCombinedAudioVideoMediaStream",getGlobalPref("ui.feedbackDialog.disabled") && "skipFeedbackDialog",...STATES.userAgent.capabilities.touch ? [getGlobalPref("touchController.mode") === "all" && "patchShowSensorControls",getGlobalPref("touchController.mode") === "all" && "exposeTouchLayoutManager",(getGlobalPref("touchController.mode") === "off" || getGlobalPref("touchController.autoOff")) && "disableTakRenderer",getGlobalPref("touchController.opacity.default") !== 100 && "patchTouchControlDefaultOpacity",getGlobalPref("touchController.mode") !== "off" && (getGlobalPref("mkb.enabled") || getGlobalPref("nativeMkb.mode") === "on") && "patchBabylonRendererClass"] : [],"patchPollGamepads",getGlobalPref("stream.video.combineAudio") && "streamCombineSources",...!getGlobalPref("block.features").includes("remote-play") ? ["remotePlayPostStreamRedirectUrl","patchRemotePlayMkb"] : [],...AppInterface && getGlobalPref("nativeMkb.mode") === "on" ? ["patchMouseAndKeyboardEnabled","disableNativeRequestPointerLock"] : [] -]), PRODUCT_DETAIL_PAGE_PATCH_ORDERS = PatcherUtils.filterPatches(["detectProductDetailPage" -]), ALL_PATCHES = [...PATCH_ORDERS, ...HOME_PAGE_PATCH_ORDERS, ...STREAM_PAGE_PATCH_ORDERS, ...PRODUCT_DETAIL_PAGE_PATCH_ORDERS]; -class Patcher {static remainingPatches = {home: HOME_PAGE_PATCH_ORDERS,stream: STREAM_PAGE_PATCH_ORDERS,"remote-play-stream": STREAM_PAGE_PATCH_ORDERS,"product-detail": PRODUCT_DETAIL_PAGE_PATCH_ORDERS};static patchPage(page) {let remaining = Patcher.remainingPatches[page];if (!remaining) return;PATCH_ORDERS = PATCH_ORDERS.concat(remaining), delete Patcher.remainingPatches[page];}static patchNativeBind() {let nativeBind = Function.prototype.bind;Function.prototype.bind = function() {let valid = !1;if (this.name.length <= 2 && arguments.length === 2 && arguments[0] === null) {if (arguments[1] === 0 || typeof arguments[1] === "function") valid = !0;}if (!valid) return nativeBind.apply(this, arguments);if (typeof arguments[1] === "function") BxLogger.info(LOG_TAG2, "Restored Function.prototype.bind()"), Function.prototype.bind = nativeBind;let orgFunc = this, newFunc = (a, item2) => {Patcher.checkChunks(item2), orgFunc(a, item2);};return nativeBind.apply(newFunc, arguments);};}static checkChunks(item) {let patchesToCheck, appliedPatches, chunkData = item[1], patchesMap = {}, patcherCache = PatcherCache.getInstance();for (let chunkId in chunkData) {appliedPatches = [];let cachedPatches = patcherCache.getPatches(chunkId);if (cachedPatches) patchesToCheck = cachedPatches.slice(0), patchesToCheck.push(...PATCH_ORDERS);else patchesToCheck = PATCH_ORDERS.slice(0);if (!patchesToCheck.length) continue;let func = chunkData[chunkId], funcStr = func.toString(), patchedFuncStr = funcStr, modified = !1, chunkAppliedPatches = [];for (let patchIndex = 0;patchIndex < patchesToCheck.length; patchIndex++) {let patchName = patchesToCheck[patchIndex];if (appliedPatches.indexOf(patchName) > -1) continue;if (!PATCHES[patchName]) continue;let tmpStr = PATCHES[patchName].call(null, patchedFuncStr);if (!tmpStr) continue;modified = !0, patchedFuncStr = tmpStr, appliedPatches.push(patchName), chunkAppliedPatches.push(patchName), patchesToCheck.splice(patchIndex, 1), patchIndex--, PATCH_ORDERS = PATCH_ORDERS.filter((item2) => item2 != patchName);}if (modified) {BxLogger.info(LOG_TAG2, `✅ [${chunkId}] ${chunkAppliedPatches.join(", ")}`), PATCH_ORDERS.length && BxLogger.info(LOG_TAG2, "Remaining patches", PATCH_ORDERS), BX_FLAGS.Debug && console.time(LOG_TAG2);try {chunkData[chunkId] = eval(patchedFuncStr);} catch (e) {if (e instanceof Error) BxLogger.error(LOG_TAG2, "Error", appliedPatches, e.message, patchedFuncStr);}BX_FLAGS.Debug && console.timeEnd(LOG_TAG2);}if (appliedPatches.length) patchesMap[chunkId] = appliedPatches;}if (Object.keys(patchesMap).length) patcherCache.saveToCache(patchesMap);}static init() {Patcher.patchNativeBind();}} -class PatcherCache {static instance;static getInstance = () => PatcherCache.instance ?? (PatcherCache.instance = new PatcherCache);KEY_CACHE = "BetterXcloud.Patches.Cache";KEY_SIGNATURE = "BetterXcloud.Patches.Cache.Signature";CACHE;constructor() {this.checkSignature(), this.CACHE = JSON.parse(window.localStorage.getItem(this.KEY_CACHE) || "{}"), BxLogger.info(LOG_TAG2, "Cache", this.CACHE);let pathName = window.location.pathname;if (pathName.includes("/play/consoles/launch/")) Patcher.patchPage("remote-play-stream");else if (pathName.includes("/play/launch/")) Patcher.patchPage("stream");else if (pathName.includes("/play/games/")) Patcher.patchPage("product-detail");else if (pathName.endsWith("/play") || pathName.endsWith("/play/")) Patcher.patchPage("home");PATCH_ORDERS = this.cleanupPatches(PATCH_ORDERS), STREAM_PAGE_PATCH_ORDERS = this.cleanupPatches(STREAM_PAGE_PATCH_ORDERS), PRODUCT_DETAIL_PAGE_PATCH_ORDERS = this.cleanupPatches(PRODUCT_DETAIL_PAGE_PATCH_ORDERS), BxLogger.info(LOG_TAG2, "PATCH_ORDERS", PATCH_ORDERS.slice(0));}getSignature() {let scriptVersion = SCRIPT_VERSION, patches = JSON.stringify(ALL_PATCHES), clientHash = "", $link = document.querySelector('link[data-chunk="client"][as="script"][href*="/client."]');if ($link) {let match = /\/client\.([^\.]+)\.js/.exec($link.href);match && (clientHash = match[1]);}let webVersion = document.querySelector("meta[name=gamepass-app-version]")?.content ?? "", webVersionDate = document.querySelector("meta[name=gamepass-app-date]")?.content ?? "";return `${scriptVersion}:${clientHash}:${webVersion}:${webVersionDate}:${hashCode(patches)}`;}clear() {window.localStorage.removeItem(this.KEY_CACHE), this.CACHE = {};}checkSignature() {let storedSig = window.localStorage.getItem(this.KEY_SIGNATURE) || 0, currentSig = this.getSignature();if (currentSig !== storedSig) BxLogger.warning(LOG_TAG2, "Signature changed"), window.localStorage.setItem(this.KEY_SIGNATURE, currentSig.toString()), this.clear();else BxLogger.info(LOG_TAG2, "Signature unchanged");}cleanupPatches(patches) {return patches.filter((item2) => {for (let id in this.CACHE)if (this.CACHE[id].includes(item2)) return !1;return !0;});}getPatches(id) {return this.CACHE[id];}saveToCache(subCache) {for (let id in subCache) {let patchNames = subCache[id], data = this.CACHE[id];if (!data) this.CACHE[id] = patchNames;else for (let patchName of patchNames)if (!data.includes(patchName)) data.push(patchName);}window.localStorage.setItem(this.KEY_CACHE, JSON.stringify(this.CACHE));}} +]), ALL_PATCHES = [...PATCH_ORDERS, ...HOME_PAGE_PATCH_ORDERS, ...STREAM_PAGE_PATCH_ORDERS]; +class Patcher {static remainingPatches = {home: HOME_PAGE_PATCH_ORDERS,stream: STREAM_PAGE_PATCH_ORDERS,"remote-play-stream": STREAM_PAGE_PATCH_ORDERS};static patchPage(page) {let remaining = Patcher.remainingPatches[page];if (!remaining) return;PATCH_ORDERS = PATCH_ORDERS.concat(remaining), delete Patcher.remainingPatches[page];}static patchNativeBind() {let nativeBind = Function.prototype.bind;Function.prototype.bind = function() {let valid = !1;if (this.name.length <= 2 && arguments.length === 2 && arguments[0] === null) {if (arguments[1] === 0 || typeof arguments[1] === "function") valid = !0;}if (!valid) return nativeBind.apply(this, arguments);if (typeof arguments[1] === "function") BxLogger.info(LOG_TAG2, "Restored Function.prototype.bind()"), Function.prototype.bind = nativeBind;let orgFunc = this, newFunc = (a, item2) => {Patcher.checkChunks(item2), orgFunc(a, item2);};return nativeBind.apply(newFunc, arguments);};}static checkChunks(item) {let patchesToCheck, appliedPatches, chunkData = item[1], patchesMap = {}, patcherCache = PatcherCache.getInstance();for (let chunkId in chunkData) {appliedPatches = [];let cachedPatches = patcherCache.getPatches(chunkId);if (cachedPatches) patchesToCheck = cachedPatches.slice(0), patchesToCheck.push(...PATCH_ORDERS);else patchesToCheck = PATCH_ORDERS.slice(0);if (!patchesToCheck.length) continue;let func = chunkData[chunkId], funcStr = func.toString(), patchedFuncStr = funcStr, modified = !1, chunkAppliedPatches = [];for (let patchIndex = 0;patchIndex < patchesToCheck.length; patchIndex++) {let patchName = patchesToCheck[patchIndex];if (appliedPatches.indexOf(patchName) > -1) continue;if (!PATCHES[patchName]) continue;let tmpStr = PATCHES[patchName].call(null, patchedFuncStr);if (!tmpStr) continue;modified = !0, patchedFuncStr = tmpStr, appliedPatches.push(patchName), chunkAppliedPatches.push(patchName), patchesToCheck.splice(patchIndex, 1), patchIndex--, PATCH_ORDERS = PATCH_ORDERS.filter((item2) => item2 != patchName);}if (modified) {BxLogger.info(LOG_TAG2, `✅ [${chunkId}] ${chunkAppliedPatches.join(", ")}`), PATCH_ORDERS.length && BxLogger.info(LOG_TAG2, "Remaining patches", PATCH_ORDERS), BX_FLAGS.Debug && console.time(LOG_TAG2);try {chunkData[chunkId] = eval(patchedFuncStr);} catch (e) {if (e instanceof Error) BxLogger.error(LOG_TAG2, "Error", appliedPatches, e.message, patchedFuncStr);}BX_FLAGS.Debug && console.timeEnd(LOG_TAG2);}if (appliedPatches.length) patchesMap[chunkId] = appliedPatches;}if (Object.keys(patchesMap).length) patcherCache.saveToCache(patchesMap);}static init() {Patcher.patchNativeBind();}} +class PatcherCache {static instance;static getInstance = () => PatcherCache.instance ?? (PatcherCache.instance = new PatcherCache);KEY_CACHE = "BetterXcloud.Patches.Cache";KEY_SIGNATURE = "BetterXcloud.Patches.Cache.Signature";CACHE;constructor() {this.checkSignature(), this.CACHE = JSON.parse(window.localStorage.getItem(this.KEY_CACHE) || "{}"), BxLogger.info(LOG_TAG2, "Cache", this.CACHE);let pathName = window.location.pathname;if (pathName.includes("/play/consoles/launch/")) Patcher.patchPage("remote-play-stream");else if (pathName.includes("/play/launch/")) Patcher.patchPage("stream");else if (pathName.endsWith("/play") || pathName.endsWith("/play/")) Patcher.patchPage("home");PATCH_ORDERS = this.cleanupPatches(PATCH_ORDERS), STREAM_PAGE_PATCH_ORDERS = this.cleanupPatches(STREAM_PAGE_PATCH_ORDERS), BxLogger.info(LOG_TAG2, "PATCH_ORDERS", PATCH_ORDERS.slice(0));}getSignature() {let scriptVersion = SCRIPT_VERSION, patches = JSON.stringify(ALL_PATCHES), clientHash = "", $link = document.querySelector('link[data-chunk="client"][as="script"][href*="/client."]');if ($link) {let match = /\/client\.([^\.]+)\.js/.exec($link.href);match && (clientHash = match[1]);}let webVersion = document.querySelector("meta[name=gamepass-app-version]")?.content ?? "", webVersionDate = document.querySelector("meta[name=gamepass-app-date]")?.content ?? "";return `${scriptVersion}:${clientHash}:${webVersion}:${webVersionDate}:${hashCode(patches)}`;}clear() {window.localStorage.removeItem(this.KEY_CACHE), this.CACHE = {};}checkSignature() {let storedSig = window.localStorage.getItem(this.KEY_SIGNATURE) || 0, currentSig = this.getSignature();if (currentSig !== storedSig) BxLogger.warning(LOG_TAG2, "Signature changed"), window.localStorage.setItem(this.KEY_SIGNATURE, currentSig.toString()), this.clear();else BxLogger.info(LOG_TAG2, "Signature unchanged");}cleanupPatches(patches) {return patches.filter((item2) => {for (let id in this.CACHE)if (this.CACHE[id].includes(item2)) return !1;return !0;});}getPatches(id) {return this.CACHE[id];}saveToCache(subCache) {for (let id in subCache) {let patchNames = subCache[id], data = this.CACHE[id];if (!data) this.CACHE[id] = patchNames;else for (let patchName of patchNames)if (!data.includes(patchName)) data.push(patchName);}window.localStorage.setItem(this.KEY_CACHE, JSON.stringify(this.CACHE));}} class FullscreenText {static instance;static getInstance = () => FullscreenText.instance ?? (FullscreenText.instance = new FullscreenText);LOG_TAG = "FullscreenText";$text;constructor() {BxLogger.info(this.LOG_TAG, "constructor()"), this.$text = CE("div", {class: "bx-fullscreen-text bx-gone"}), document.documentElement.appendChild(this.$text);}show(msg) {document.body.classList.add("bx-no-scroll"), this.$text.classList.remove("bx-gone"), this.$text.textContent = msg;}hide() {document.body.classList.remove("bx-no-scroll"), this.$text.classList.add("bx-gone");}} class BaseProfileManagerDialog extends NavigationDialog {$container;title;presetsDb;allPresets;currentPresetId = null;activatedPresetId = null;$presets;$header;$defaultNote;$content;$btnRename;$btnDelete;constructor(title, presetsDb) {super();this.title = title, this.presetsDb = presetsDb;}async renderSummary(presetId) {return null;}updateButtonStates() {let isDefaultPreset = this.currentPresetId === null || this.currentPresetId <= 0;this.$btnRename.disabled = isDefaultPreset, this.$btnDelete.disabled = isDefaultPreset, this.$defaultNote.classList.toggle("bx-gone", !isDefaultPreset);}async renderPresetsList() {if (this.allPresets = await this.presetsDb.getPresets(), this.currentPresetId === null) this.currentPresetId = this.allPresets.default[0];renderPresetsList(this.$presets, this.allPresets, this.activatedPresetId, { selectedIndicator: !0 });}promptNewName(action, value = "") {let newName = "";while (!newName) {if (newName = prompt(`[${action}] ${t("prompt-preset-name")}`, value), newName === null) return !1;newName = newName.trim();}return newName ? newName : !1;}async renderDialog() {this.$presets = CE("select", {class: "bx-full-width",tabindex: -1});let $select = BxSelectElement.create(this.$presets);$select.addEventListener("input", (e) => {this.switchPreset(parseInt($select.value));});let $header = CE("div", {class: "bx-dialog-preset-tools",_nearby: {orientation: "horizontal",focus: $select}}, $select, this.$btnRename = createButton({title: t("rename"),icon: BxIcon.CURSOR_TEXT,style: 64,onClick: async () => {let preset = this.allPresets.data[this.currentPresetId], newName = this.promptNewName(t("rename"), preset.name);if (!newName) return;preset.name = newName, await this.presetsDb.updatePreset(preset), await this.refresh();}}), this.$btnDelete = createButton({icon: BxIcon.TRASH,title: t("delete"),style: 4 | 64,onClick: async (e) => {if (!confirm(t("confirm-delete-preset"))) return;await this.presetsDb.deletePreset(this.currentPresetId), delete this.allPresets.data[this.currentPresetId], this.currentPresetId = parseInt(Object.keys(this.allPresets.data)[0]), await this.refresh();}}), createButton({icon: BxIcon.NEW,title: t("new"),style: 64 | 1,onClick: async (e) => {let newName = this.promptNewName(t("new"));if (!newName) return;let newId = await this.presetsDb.newPreset(newName, this.presetsDb.BLANK_PRESET_DATA);this.currentPresetId = newId, await this.refresh();}}), createButton({icon: BxIcon.COPY,title: t("copy"),style: 64 | 1,onClick: async (e) => {let preset = this.allPresets.data[this.currentPresetId], newName = this.promptNewName(t("copy"), `${preset.name} (2)`);if (!newName) return;let newId = await this.presetsDb.newPreset(newName, preset.data);this.currentPresetId = newId, await this.refresh();}}));this.$header = $header, this.$container = CE("div", { class: "bx-centered-dialog" }, CE("div", { class: "bx-dialog-title" }, CE("p", !1, this.title), createButton({icon: BxIcon.CLOSE,style: 64 | 2048 | 8,onClick: (e) => this.hide()})), CE("div", !1, $header, this.$defaultNote = CE("div", { class: "bx-default-preset-note bx-gone" }, t("default-preset-note"))), CE("div", { class: "bx-dialog-content" }, this.$content));}async refresh() {await this.renderPresetsList(), this.$presets.value = this.currentPresetId.toString(), BxEvent.dispatch(this.$presets, "input", { manualTrigger: !0 });}async onBeforeMount(configs = {}) {await this.renderPresetsList();let valid = !1;if (typeof configs?.id === "number") {if (configs.id in this.allPresets.data) this.currentPresetId = configs.id, this.activatedPresetId = configs.id, valid = !0;}if (!valid) this.currentPresetId = this.allPresets.default[0], this.activatedPresetId = null;this.refresh();}getDialog() {return this;}getContent() {if (!this.$container) this.renderDialog();return this.$container;}focusIfNeeded() {this.dialogManager.focus(this.$header);}} var SHORTCUT_ACTIONS = {[t("better-xcloud")]: {"bx.settings.show": [t("settings"), t("show")]},...STATES.browser.capabilities.mkb ? {[t("mouse-and-keyboard")]: {"mkb.toggle": [t("toggle")]}} : {},[t("controller")]: {"controller.xbox.press": [t("button-xbox"), t("press")]},...AppInterface ? {[t("device")]: {"device.sound.toggle": [t("sound"), t("toggle")],"device.volume.inc": [t("volume"), t("increase")],"device.volume.dec": [t("volume"), t("decrease")],"device.brightness.inc": [t("brightness"), t("increase")],"device.brightness.dec": [t("brightness"), t("decrease")]}} : {},[t("stream")]: {"stream.screenshot.capture": [t("take-screenshot")],"stream.video.toggle": [t("video"), t("toggle")],"stream.sound.toggle": [t("sound"), t("toggle")],...getGlobalPref("audio.volume.booster.enabled") ? {"stream.volume.inc": [t("volume"), t("increase")],"stream.volume.dec": [t("volume"), t("decrease")]} : {},"stream.menu.show": [t("menu"), t("show")],"stream.stats.toggle": [t("stats"), t("show-hide")],"stream.microphone.toggle": [t("microphone"), t("toggle")]},[t("other")]: {"ta.open": [t("true-achievements"), t("show")]}}; diff --git a/src/modules/patcher/patcher.ts b/src/modules/patcher/patcher.ts index 717790f..206f90b 100755 --- a/src/modules/patcher/patcher.ts +++ b/src/modules/patcher/patcher.ts @@ -21,7 +21,7 @@ import { PatcherUtils } from "./patcher-utils.js"; export type PatchName = keyof typeof PATCHES; export type PatchArray = PatchName[]; -export type PatchPage = 'home' | 'stream' | 'remote-play-stream' | 'product-detail'; +export type PatchPage = 'home' | 'stream' | 'remote-play-stream'; type PatchFunction = (str: string) => string | false; const LOG_TAG = 'Patcher'; @@ -959,10 +959,6 @@ if (this.baseStorageKey in window.BX_EXPOSED.overrideSettings) { return PatcherUtils.patchBeforePageLoad(str, 'home'); }, - productDetailPageBeforeLoad(str: string) { - return PatcherUtils.patchBeforePageLoad(str, 'product-detail'); - }, - streamPageBeforeLoad(str: string) { return PatcherUtils.patchBeforePageLoad(str, 'stream'); }, @@ -1345,12 +1341,12 @@ let PATCH_ORDERS = PatcherUtils.filterPatches([ 'gameCardCustomIcons', // 'gameCardPassTitle', - 'productDetailPageBeforeLoad', - 'enableTvRoutes', 'overrideStorageGetSettings', + 'detectProductDetailPage', + getGlobalPref(GlobalPref.UI_LAYOUT) !== UiLayout.DEFAULT && 'websiteLayout', getGlobalPref(GlobalPref.GAME_FORTNITE_FORCE_CONSOLE) && 'forceFortniteConsole', @@ -1449,18 +1445,13 @@ let STREAM_PAGE_PATCH_ORDERS = PatcherUtils.filterPatches([ ] : []) as PatchArray, ]); -let PRODUCT_DETAIL_PAGE_PATCH_ORDERS = PatcherUtils.filterPatches([ - 'detectProductDetailPage', -]); - -const ALL_PATCHES = [...PATCH_ORDERS, ...HOME_PAGE_PATCH_ORDERS, ...STREAM_PAGE_PATCH_ORDERS, ...PRODUCT_DETAIL_PAGE_PATCH_ORDERS]; +const ALL_PATCHES = [...PATCH_ORDERS, ...HOME_PAGE_PATCH_ORDERS, ...STREAM_PAGE_PATCH_ORDERS]; export class Patcher { private static remainingPatches: { [key in PatchPage]: PatchArray } = { home: HOME_PAGE_PATCH_ORDERS, stream: STREAM_PAGE_PATCH_ORDERS, 'remote-play-stream': STREAM_PAGE_PATCH_ORDERS, - 'product-detail': PRODUCT_DETAIL_PAGE_PATCH_ORDERS, }; static patchPage(page: PatchPage) { @@ -1627,8 +1618,6 @@ export class PatcherCache { Patcher.patchPage('remote-play-stream'); } else if (pathName.includes('/play/launch/')) { Patcher.patchPage('stream'); - } else if (pathName.includes('/play/games/')) { - Patcher.patchPage('product-detail'); } else if (pathName.endsWith('/play') || pathName.endsWith('/play/')) { Patcher.patchPage('home'); } @@ -1636,7 +1625,6 @@ export class PatcherCache { // Remove cached patches from PATCH_ORDERS & PLAYING_PATCH_ORDERS PATCH_ORDERS = this.cleanupPatches(PATCH_ORDERS); STREAM_PAGE_PATCH_ORDERS = this.cleanupPatches(STREAM_PAGE_PATCH_ORDERS); - PRODUCT_DETAIL_PAGE_PATCH_ORDERS = this.cleanupPatches(PRODUCT_DETAIL_PAGE_PATCH_ORDERS); BxLogger.info(LOG_TAG, 'PATCH_ORDERS', PATCH_ORDERS.slice(0)); }