Remote Play: Prevent adding "Fortnite" to the "Jump back in" list

This commit is contained in:
redphx 2024-09-20 16:42:27 +07:00
parent c90e013dc1
commit 9308963bc2

View File

@ -151,22 +151,41 @@ const PATCHES = {
return str.replace(text, codeRemotePlayEnable);
},
// Disable achievement toast in Remote Play
// Remote Play: Disable achievement toast
remotePlayDisableAchievementToast(str: string) {
const text = '.AchievementUnlock:{';
if (!str.includes(text)) {
return false;
}
const newCode = `
if (!!window.BX_REMOTE_PLAY_CONFIG) {
return;
}
`;
const newCode = `if (!!window.BX_REMOTE_PLAY_CONFIG) return;`;
return str.replace(text, text + newCode);
},
// Remote Play: Prevent adding "Fortnite" to the "Jump back in" list
remotePlayRecentlyUsedTitleIds(str: string) {
const text = '(e.data.recentlyUsedTitleIds)){';
if (!str.includes(text)) {
return false;
}
const newCode = `if (window.BX_REMOTE_PLAY_CONFIG) return;`;
return str.replace(text, text + newCode);
},
// Remote Play: change web page's title
/*
remotePlayWebTitle(str: string) {
const text = '"undefined"!==typeof e&&document.title!==e';
if (!str.includes(text)) {
return false;
}
const newCode = `if (window.BX_REMOTE_PLAY_CONFIG) { e = "${t('remote-play')} - ${t('better-xcloud')}"; }`;
return str.replace(text, newCode + text);
},
*/
// Block WebRTC stats collector
blockWebRtcStatsCollector(str: string) {
const text = 'this.shouldCollectStats=!0';
@ -984,6 +1003,7 @@ let PATCH_ORDERS: PatchArray = [
'remotePlayKeepAlive',
'remotePlayDirectConnectUrl',
'remotePlayDisableAchievementToast',
'remotePlayRecentlyUsedTitleIds',
STATES.userAgent.capabilities.touch && 'patchUpdateInputConfigurationAsync',
] : []),