Add patch to modify __PRELOADED_STATE__

This commit is contained in:
redphx
2024-11-01 16:55:58 +07:00
parent f6581abe34
commit e8376b52fe
8 changed files with 88 additions and 91 deletions

View File

@@ -985,6 +985,16 @@ if (this.baseStorageKey in window.BX_EXPOSED.overrideSettings) {
return str;
},
modifyPreloadedState(str: string) {
let text = '=window.__PRELOADED_STATE__;';
if (!str.includes(text)) {
return false;
}
str = str.replace(text, '=window.BX_EXPOSED.modifyPreloadedState(window.__PRELOADED_STATE__);');
return str;
},
};
let PATCH_ORDERS: PatchArray = [
@@ -995,6 +1005,8 @@ let PATCH_ORDERS: PatchArray = [
'exposeInputSink',
] : []),
'modifyPreloadedState',
'optimizeGameSlugGenerator',
'detectBrowserRouterReady',