From 9308963bc2748f2e3839c1ceae8d58d05db74deb Mon Sep 17 00:00:00 2001 From: redphx <96280+redphx@users.noreply.github.com> Date: Fri, 20 Sep 2024 16:42:27 +0700 Subject: [PATCH] Remote Play: Prevent adding "Fortnite" to the "Jump back in" list --- src/modules/patcher.ts | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/src/modules/patcher.ts b/src/modules/patcher.ts index 8290f6e..3a944f8 100644 --- a/src/modules/patcher.ts +++ b/src/modules/patcher.ts @@ -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', ] : []),