Update better-xcloud.user.js

This commit is contained in:
redphx 2024-07-27 11:36:48 +07:00 committed by GitHub
parent 70d5d62890
commit a44714ed29
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -14,16 +14,15 @@
// ==/UserScript== // ==/UserScript==
'use strict'; 'use strict';
// src/enums/user-agent.ts // src/enums/user-agent.ts
var UserAgentProfile; var UserAgentProfile = {
(function(UserAgentProfile2) { WINDOWS_EDGE: "windows-edge",
UserAgentProfile2["WINDOWS_EDGE"] = "windows-edge"; MACOS_SAFARI: "macos-safari",
UserAgentProfile2["MACOS_SAFARI"] = "macos-safari"; SMART_TV_GENERIC: "smarttv-generic",
UserAgentProfile2["SMART_TV_GENERIC"] = "smarttv-generic"; SMART_TV_TIZEN: "smarttv-tizen",
UserAgentProfile2["SMART_TV_TIZEN"] = "smarttv-tizen"; VR_OCULUS: "vr-oculus",
UserAgentProfile2["VR_OCULUS"] = "vr-oculus"; DEFAULT: "default",
UserAgentProfile2["DEFAULT"] = "default"; CUSTOM: "custom"
UserAgentProfile2["CUSTOM"] = "custom"; };
})(UserAgentProfile || (UserAgentProfile = {}));
// src/utils/bx-flags.ts // src/utils/bx-flags.ts
@ -396,12 +395,11 @@ var PrefKey;
})(PrefKey || (PrefKey = {})); })(PrefKey || (PrefKey = {}));
// src/utils/bx-logger.ts // src/utils/bx-logger.ts
var TextColor; var TextColor = {
(function(TextColor2) { INFO: "#008746",
TextColor2["INFO"] = "#008746"; WARNING: "#c1a404",
TextColor2["WARNING"] = "#c1a404"; ERROR: "#c10404"
TextColor2["ERROR"] = "#c10404"; };
})(TextColor || (TextColor = {}));
class BxLogger { class BxLogger {
static #PREFIX = "[BxC]"; static #PREFIX = "[BxC]";
@ -824,15 +822,14 @@ var BypassServers = {
}; };
// src/enums/ui-sections.ts // src/enums/ui-sections.ts
var UiSection; var UiSection = {
(function(UiSection2) { ALL_GAMES: "all-games",
UiSection2["ALL_GAMES"] = "all-games"; FRIENDS: "friends",
UiSection2["FRIENDS"] = "friends"; MOST_POPULAR: "most-popular",
UiSection2["MOST_POPULAR"] = "most-popular"; NATIVE_MKB: "native-mkb",
UiSection2["NATIVE_MKB"] = "native-mkb"; NEWS: "news",
UiSection2["NEWS"] = "news"; TOUCH: "touch"
UiSection2["TOUCH"] = "touch"; };
})(UiSection || (UiSection = {}));
// src/modules/stream/stream-stats.ts // src/modules/stream/stream-stats.ts
var StreamStat; var StreamStat;
@ -3939,13 +3936,12 @@ if (BX_FLAGS.FeatureGates)
FeatureGates = Object.assign(BX_FLAGS.FeatureGates, FeatureGates); FeatureGates = Object.assign(BX_FLAGS.FeatureGates, FeatureGates);
// src/enums/game-pass-gallery.ts // src/enums/game-pass-gallery.ts
var GamePassCloudGallery; var GamePassCloudGallery = {
(function(GamePassCloudGallery2) { ALL: "29a81209-df6f-41fd-a528-2ae6b91f719c",
GamePassCloudGallery2["ALL"] = "29a81209-df6f-41fd-a528-2ae6b91f719c"; MOST_POPULAR: "e7590b22-e299-44db-ae22-25c61405454c",
GamePassCloudGallery2["MOST_POPULAR"] = "e7590b22-e299-44db-ae22-25c61405454c"; NATIVE_MKB: "8fa264dd-124f-4af3-97e8-596fcdf4b486",
GamePassCloudGallery2["NATIVE_MKB"] = "8fa264dd-124f-4af3-97e8-596fcdf4b486"; TOUCH: "9c86f07a-f3e8-45ad-82a0-a1f759597059"
GamePassCloudGallery2["TOUCH"] = "9c86f07a-f3e8-45ad-82a0-a1f759597059"; };
})(GamePassCloudGallery || (GamePassCloudGallery = {}));
// src/modules/patcher.ts // src/modules/patcher.ts
var ENDING_CHUNKS_PATCH_NAME = "loadingEndingChunks", LOG_TAG3 = "Patcher", PATCHES = { var ENDING_CHUNKS_PATCH_NAME = "loadingEndingChunks", LOG_TAG3 = "Patcher", PATCHES = {
@ -5778,22 +5774,21 @@ class StreamUiShortcut {
} }
// src/modules/controller-shortcut.ts // src/modules/controller-shortcut.ts
var ShortcutAction; var ShortcutAction = {
(function(ShortcutAction2) { BETTER_XCLOUD_SETTINGS_SHOW: "bx-settings-show",
ShortcutAction2["BETTER_XCLOUD_SETTINGS_SHOW"] = "bx-settings-show"; STREAM_SCREENSHOT_CAPTURE: "stream-screenshot-capture",
ShortcutAction2["STREAM_SCREENSHOT_CAPTURE"] = "stream-screenshot-capture"; STREAM_MENU_SHOW: "stream-menu-show",
ShortcutAction2["STREAM_MENU_SHOW"] = "stream-menu-show"; STREAM_STATS_TOGGLE: "stream-stats-toggle",
ShortcutAction2["STREAM_STATS_TOGGLE"] = "stream-stats-toggle"; STREAM_SOUND_TOGGLE: "stream-sound-toggle",
ShortcutAction2["STREAM_SOUND_TOGGLE"] = "stream-sound-toggle"; STREAM_MICROPHONE_TOGGLE: "stream-microphone-toggle",
ShortcutAction2["STREAM_MICROPHONE_TOGGLE"] = "stream-microphone-toggle"; STREAM_VOLUME_INC: "stream-volume-inc",
ShortcutAction2["STREAM_VOLUME_INC"] = "stream-volume-inc"; STREAM_VOLUME_DEC: "stream-volume-dec",
ShortcutAction2["STREAM_VOLUME_DEC"] = "stream-volume-dec"; DEVICE_SOUND_TOGGLE: "device-sound-toggle",
ShortcutAction2["DEVICE_SOUND_TOGGLE"] = "device-sound-toggle"; DEVICE_VOLUME_INC: "device-volume-inc",
ShortcutAction2["DEVICE_VOLUME_INC"] = "device-volume-inc"; DEVICE_VOLUME_DEC: "device-volume-dec",
ShortcutAction2["DEVICE_VOLUME_DEC"] = "device-volume-dec"; DEVICE_BRIGHTNESS_INC: "device-brightness-inc",
ShortcutAction2["DEVICE_BRIGHTNESS_INC"] = "device-brightness-inc"; DEVICE_BRIGHTNESS_DEC: "device-brightness-dec"
ShortcutAction2["DEVICE_BRIGHTNESS_DEC"] = "device-brightness-dec"; };
})(ShortcutAction || (ShortcutAction = {}));
class ControllerShortcut { class ControllerShortcut {
static #STORAGE_KEY = "better_xcloud_controller_shortcuts"; static #STORAGE_KEY = "better_xcloud_controller_shortcuts";
@ -6160,13 +6155,12 @@ class HeaderSection {
} }
// src/modules/remote-play.ts // src/modules/remote-play.ts
var LOG_TAG5 = "RemotePlay", RemotePlayConsoleState; var LOG_TAG5 = "RemotePlay", RemotePlayConsoleState = {
(function(RemotePlayConsoleState2) { ON: "On",
RemotePlayConsoleState2["ON"] = "On"; OFF: "Off",
RemotePlayConsoleState2["OFF"] = "Off"; STANDBY: "ConnectedStandby",
RemotePlayConsoleState2["STANDBY"] = "ConnectedStandby"; UNKNOWN: "Unknown"
RemotePlayConsoleState2["UNKNOWN"] = "Unknown"; };
})(RemotePlayConsoleState || (RemotePlayConsoleState = {}));
class RemotePlay { class RemotePlay {
static XCLOUD_TOKEN; static XCLOUD_TOKEN;
@ -6184,8 +6178,8 @@ class RemotePlay {
env: { env: {
clientAppId: window.location.host, clientAppId: window.location.host,
clientAppType: "browser", clientAppType: "browser",
clientAppVersion: "21.1.98", clientAppVersion: "24.17.36",
clientSdkVersion: "8.5.3", clientSdkVersion: "10.1.14",
httpEnvironment: "prod", httpEnvironment: "prod",
sdkInstallId: "" sdkInstallId: ""
} }
@ -6213,7 +6207,7 @@ class RemotePlay {
}, },
browser: { browser: {
browserName: "chrome", browserName: "chrome",
browserVersion: "119.0" browserVersion: "125.0"
} }
} }
}; };
@ -6589,17 +6583,15 @@ class LoadingScreen {
} }
// src/modules/stream/stream-badges.ts // src/modules/stream/stream-badges.ts
var StreamBadge; var StreamBadge = {
(function(StreamBadge2) { PLAYTIME: "playtime",
StreamBadge2["PLAYTIME"] = "playtime"; BATTERY: "battery",
StreamBadge2["BATTERY"] = "battery"; DOWNLOAD: "in",
StreamBadge2["DOWNLOAD"] = "in"; UPLOAD: "out",
StreamBadge2["UPLOAD"] = "out"; SERVER: "server",
StreamBadge2["SERVER"] = "server"; VIDEO: "video",
StreamBadge2["VIDEO"] = "video"; AUDIO: "audio"
StreamBadge2["AUDIO"] = "audio"; }, StreamBadgeIcon = {
})(StreamBadge || (StreamBadge = {}));
var StreamBadgeIcon = {
[StreamBadge.PLAYTIME]: BxIcon.PLAYTIME, [StreamBadge.PLAYTIME]: BxIcon.PLAYTIME,
[StreamBadge.VIDEO]: BxIcon.DISPLAY, [StreamBadge.VIDEO]: BxIcon.DISPLAY,
[StreamBadge.BATTERY]: BxIcon.BATTERY, [StreamBadge.BATTERY]: BxIcon.BATTERY,
@ -7071,19 +7063,14 @@ function interceptHttpRequests() {
} }
let requestType; let requestType;
if (url.includes("/sessions/home") || url.includes("xhome.") || STATES.remotePlay.isPlaying && url.endsWith("/inputconfigs")) if (url.includes("/sessions/home") || url.includes("xhome.") || STATES.remotePlay.isPlaying && url.endsWith("/inputconfigs"))
requestType = RequestType.XHOME; requestType = "xhome";
else else
requestType = RequestType.XCLOUD; requestType = "xcloud";
if (requestType === RequestType.XHOME) if (requestType === "xhome")
return XhomeInterceptor.handle(request); return XhomeInterceptor.handle(request);
return XcloudInterceptor.handle(request, init); return XcloudInterceptor.handle(request, init);
}; };
} }
var RequestType;
(function(RequestType2) {
RequestType2["XCLOUD"] = "xcloud";
RequestType2["XHOME"] = "xhome";
})(RequestType || (RequestType = {}));
// src/utils/gamepad.ts // src/utils/gamepad.ts
function showGamepadToast(gamepad) { function showGamepadToast(gamepad) {
@ -7962,11 +7949,6 @@ class GameBar {
} }
// src/modules/ui/guide-menu.ts // src/modules/ui/guide-menu.ts
var GuideMenuTab;
(function(GuideMenuTab2) {
GuideMenuTab2[GuideMenuTab2["HOME"] = 0] = "HOME";
})(GuideMenuTab || (GuideMenuTab = {}));
class GuideMenu { class GuideMenu {
static #BUTTONS = { static #BUTTONS = {
scriptSettings: createButton({ scriptSettings: createButton({
@ -8038,7 +8020,7 @@ class GuideMenu {
$btnXcloudHome && ($btnXcloudHome.style.display = "none"); $btnXcloudHome && ($btnXcloudHome.style.display = "none");
} }
static async#onShown(e) { static async#onShown(e) {
if (e.where === GuideMenuTab.HOME) { if (e.where === "home") {
const $root = document.querySelector("#gamepass-dialog-root div[role=dialog] div[role=tabpanel] div[class*=HomeLandingPage]"); const $root = document.querySelector("#gamepass-dialog-root div[role=dialog] div[role=tabpanel] div[class*=HomeLandingPage]");
if ($root) if ($root)
if (STATES.isPlaying) if (STATES.isPlaying)
@ -8210,7 +8192,7 @@ var unload = function() {
for (index = 0;$elm = $elm?.previousElementSibling; index++) for (index = 0;$elm = $elm?.previousElementSibling; index++)
; ;
if (index === 0) if (index === 0)
BxEvent.dispatch(window, BxEvent.XCLOUD_GUIDE_MENU_SHOWN, { where: GuideMenuTab.HOME }); BxEvent.dispatch(window, BxEvent.XCLOUD_GUIDE_MENU_SHOWN, { where: "home" });
} }
} }
} }