Show "Remote Play" on web's title instead of "Fortnite"

This commit is contained in:
redphx 2024-11-01 08:53:24 +07:00
parent b090d325ae
commit f6581abe34
2 changed files with 13 additions and 6 deletions

View File

@ -4044,6 +4044,11 @@ var ENDING_CHUNKS_PATCH_NAME = "loadingEndingChunks", LOG_TAG2 = "Patcher", PATC
let newCode = "if (window.BX_REMOTE_PLAY_CONFIG) return;"; let newCode = "if (window.BX_REMOTE_PLAY_CONFIG) return;";
return str.replace(text, text + newCode); return str.replace(text, text + newCode);
}, },
remotePlayWebTitle(str) {
let text = "titleTemplate:void 0,title:", index = str.indexOf(text);
if (index < 0) return !1;
return str = PatcherUtils.insertAt(str, index + text.length, `!!window.BX_REMOTE_PLAY_CONFIG ? "${t("remote-play")} - Better xCloud" :`), str;
},
blockWebRtcStatsCollector(str) { blockWebRtcStatsCollector(str) {
let text = "this.shouldCollectStats=!0"; let text = "this.shouldCollectStats=!0";
if (!str.includes(text)) return !1; if (!str.includes(text)) return !1;
@ -4450,6 +4455,7 @@ if (this.baseStorageKey in window.BX_EXPOSED.overrideSettings) {
"remotePlayDirectConnectUrl", "remotePlayDirectConnectUrl",
"remotePlayDisableAchievementToast", "remotePlayDisableAchievementToast",
"remotePlayRecentlyUsedTitleIds", "remotePlayRecentlyUsedTitleIds",
"remotePlayWebTitle",
STATES.userAgent.capabilities.touch && "patchUpdateInputConfigurationAsync" STATES.userAgent.capabilities.touch && "patchUpdateInputConfigurationAsync"
] : [], ] : [],
...BX_FLAGS.EnableXcloudLogging ? [ ...BX_FLAGS.EnableXcloudLogging ? [

View File

@ -17,6 +17,7 @@ import { UiSection } from "@/enums/ui-sections.js";
import { PrefKey } from "@/enums/pref-keys.js"; import { PrefKey } from "@/enums/pref-keys.js";
import { getPref, StreamTouchController } from "@/utils/settings-storages/global-settings-storage"; import { getPref, StreamTouchController } from "@/utils/settings-storages/global-settings-storage";
import { GamePassCloudGallery } from "@/enums/game-pass-gallery.js"; import { GamePassCloudGallery } from "@/enums/game-pass-gallery.js";
import { t } from "@/utils/translation.js";
type PatchArray = (keyof typeof PATCHES)[]; type PatchArray = (keyof typeof PATCHES)[];
@ -174,17 +175,16 @@ const PATCHES = {
}, },
// Remote Play: change web page's title // Remote Play: change web page's title
/*
remotePlayWebTitle(str: string) { remotePlayWebTitle(str: string) {
let text = '"undefined"!==typeof e&&document.title!==e'; let text = 'titleTemplate:void 0,title:';
if (!str.includes(text)) { const index = str.indexOf(text);
if (index < 0) {
return false; return false;
} }
const newCode = `if (window.BX_REMOTE_PLAY_CONFIG) { e = "${t('remote-play')} - ${t('better-xcloud')}"; }`; str = PatcherUtils.insertAt(str, index + text.length, `!!window.BX_REMOTE_PLAY_CONFIG ? "${t('remote-play')} - Better xCloud" :`);
return str.replace(text, newCode + text); return str;
}, },
*/
// Block WebRTC stats collector // Block WebRTC stats collector
blockWebRtcStatsCollector(str: string) { blockWebRtcStatsCollector(str: string) {
@ -1044,6 +1044,7 @@ let PATCH_ORDERS: PatchArray = [
'remotePlayDirectConnectUrl', 'remotePlayDirectConnectUrl',
'remotePlayDisableAchievementToast', 'remotePlayDisableAchievementToast',
'remotePlayRecentlyUsedTitleIds', 'remotePlayRecentlyUsedTitleIds',
'remotePlayWebTitle',
STATES.userAgent.capabilities.touch && 'patchUpdateInputConfigurationAsync', STATES.userAgent.capabilities.touch && 'patchUpdateInputConfigurationAsync',
] : []), ] : []),