fix: remove "productDetailPageBeforeLoad" patch

This commit is contained in:
redphx
2025-09-21 15:35:07 +07:00
parent 822d1e696b
commit 2260304313
3 changed files with 13 additions and 33 deletions

View File

@@ -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."]');

File diff suppressed because one or more lines are too long

View File

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