Compare commits

..

4 Commits

Author SHA1 Message Date
2f280cf6e9 Bump version to 5.9.7 2024-11-24 21:32:42 +07:00
24c3588f1a Update GamePassCloudGallery. ALL sigl 2024-11-24 21:11:27 +07:00
330b7362ed Bump version to 5.9.6 2024-11-19 06:01:24 +07:00
5d177bd76c Fix "guideAchievementsDefaultLocked" patch 2024-11-18 22:01:24 +07:00
5 changed files with 16 additions and 16 deletions

View File

@ -1,7 +1,7 @@
// ==UserScript== // ==UserScript==
// @name Better xCloud (Lite) // @name Better xCloud (Lite)
// @namespace https://github.com/redphx // @namespace https://github.com/redphx
// @version 5.9.5 // @version 5.9.7
// @description Improve Xbox Cloud Gaming (xCloud) experience // @description Improve Xbox Cloud Gaming (xCloud) experience
// @author redphx // @author redphx
// @license MIT // @license MIT
@ -105,7 +105,7 @@ class UserAgent {
}); });
} }
} }
var SCRIPT_VERSION = "5.9.5", SCRIPT_VARIANT = "lite", AppInterface = window.AppInterface; var SCRIPT_VERSION = "5.9.7", SCRIPT_VARIANT = "lite", AppInterface = window.AppInterface;
UserAgent.init(); UserAgent.init();
var userAgent = window.navigator.userAgent.toLowerCase(), isTv = userAgent.includes("smart-tv") || userAgent.includes("smarttv") || /\baft.*\b/.test(userAgent), isVr = window.navigator.userAgent.includes("VR") && window.navigator.userAgent.includes("OculusBrowser"), browserHasTouchSupport = "ontouchstart" in window || navigator.maxTouchPoints > 0, userAgentHasTouchSupport = !isTv && !isVr && browserHasTouchSupport, supportMkb = AppInterface || !userAgent.match(/(android|iphone|ipad)/), STATES = { var userAgent = window.navigator.userAgent.toLowerCase(), isTv = userAgent.includes("smart-tv") || userAgent.includes("smarttv") || /\baft.*\b/.test(userAgent), isVr = window.navigator.userAgent.includes("VR") && window.navigator.userAgent.includes("OculusBrowser"), browserHasTouchSupport = "ontouchstart" in window || navigator.maxTouchPoints > 0, userAgentHasTouchSupport = !isTv && !isVr && browserHasTouchSupport, supportMkb = AppInterface || !userAgent.match(/(android|iphone|ipad)/), STATES = {
supportedRegion: !0, supportedRegion: !0,
@ -5288,7 +5288,7 @@ function interceptHttpRequests() {
} }
if (STATES.userAgent.capabilities.touch && url.includes("catalog.gamepass.com/sigls/")) { if (STATES.userAgent.capabilities.touch && url.includes("catalog.gamepass.com/sigls/")) {
let response = await NATIVE_FETCH(request, init), obj = await response.clone().json(); let response = await NATIVE_FETCH(request, init), obj = await response.clone().json();
if (url.includes("29a81209-df6f-41fd-a528-2ae6b91f719c")) for (let i = 1;i < obj.length; i++) if (url.includes("ce573635-7c18-4d0c-9d68-90b932393470")) for (let i = 1;i < obj.length; i++)
gamepassAllGames.push(obj[i].id); gamepassAllGames.push(obj[i].id);
else if (!1) try {} catch (e) {} else if (!1) try {} catch (e) {}
return response.json = () => Promise.resolve(obj), response; return response.json = () => Promise.resolve(obj), response;

View File

@ -1,5 +1,5 @@
// ==UserScript== // ==UserScript==
// @name Better xCloud // @name Better xCloud
// @namespace https://github.com/redphx // @namespace https://github.com/redphx
// @version 5.9.5 // @version 5.9.7
// ==/UserScript== // ==/UserScript==

View File

@ -1,7 +1,7 @@
// ==UserScript== // ==UserScript==
// @name Better xCloud // @name Better xCloud
// @namespace https://github.com/redphx // @namespace https://github.com/redphx
// @version 5.9.5 // @version 5.9.7
// @description Improve Xbox Cloud Gaming (xCloud) experience // @description Improve Xbox Cloud Gaming (xCloud) experience
// @author redphx // @author redphx
// @license MIT // @license MIT
@ -107,7 +107,7 @@ class UserAgent {
}); });
} }
} }
var SCRIPT_VERSION = "5.9.5", SCRIPT_VARIANT = "full", AppInterface = window.AppInterface; var SCRIPT_VERSION = "5.9.7", SCRIPT_VARIANT = "full", AppInterface = window.AppInterface;
UserAgent.init(); UserAgent.init();
var userAgent = window.navigator.userAgent.toLowerCase(), isTv = userAgent.includes("smart-tv") || userAgent.includes("smarttv") || /\baft.*\b/.test(userAgent), isVr = window.navigator.userAgent.includes("VR") && window.navigator.userAgent.includes("OculusBrowser"), browserHasTouchSupport = "ontouchstart" in window || navigator.maxTouchPoints > 0, userAgentHasTouchSupport = !isTv && !isVr && browserHasTouchSupport, supportMkb = AppInterface || !userAgent.match(/(android|iphone|ipad)/), STATES = { var userAgent = window.navigator.userAgent.toLowerCase(), isTv = userAgent.includes("smart-tv") || userAgent.includes("smarttv") || /\baft.*\b/.test(userAgent), isVr = window.navigator.userAgent.includes("VR") && window.navigator.userAgent.includes("OculusBrowser"), browserHasTouchSupport = "ontouchstart" in window || navigator.maxTouchPoints > 0, userAgentHasTouchSupport = !isTv && !isVr && browserHasTouchSupport, supportMkb = AppInterface || !userAgent.match(/(android|iphone|ipad)/), STATES = {
supportedRegion: !0, supportedRegion: !0,
@ -4399,9 +4399,9 @@ if (this.baseStorageKey in window.BX_EXPOSED.overrideSettings) {
}, },
guideAchievementsDefaultLocked(str) { guideAchievementsDefaultLocked(str) {
let index = str.indexOf("FilterButton-module__container"); let index = str.indexOf("FilterButton-module__container");
if (index >= 0 && (index = PatcherUtils.lastIndexOf(str, ".All", index, 150)), index < 0) return !1; if (index >= 0 && (index = PatcherUtils.lastIndexOf(str, '"All"', index, 150)), index < 0) return !1;
if (str = PatcherUtils.replaceWith(str, index, ".All", ".Locked"), index = str.indexOf('"Guide_Achievements_Unlocked_Empty","Guide_Achievements_Locked_Empty"'), index >= 0 && (index = PatcherUtils.indexOf(str, ".All", index, 250)), index < 0) return !1; if (str = PatcherUtils.replaceWith(str, index, '"All"', '"Locked"'), index = str.indexOf('"Guide_Achievements_Unlocked_Empty","Guide_Achievements_Locked_Empty"'), index >= 0 && (index = PatcherUtils.indexOf(str, '"All"', index, 250)), index < 0) return !1;
return str = PatcherUtils.replaceWith(str, index, ".All", ".Locked"), str; return str = PatcherUtils.replaceWith(str, index, '"All"', '"Locked"'), str;
}, },
disableTouchContextMenu(str) { disableTouchContextMenu(str) {
let index = str.indexOf('"ContextualCardActions-module__container'); let index = str.indexOf('"ContextualCardActions-module__container');
@ -5795,7 +5795,7 @@ var BxExposed = {
try { try {
let sigls = state.xcloud.sigls; let sigls = state.xcloud.sigls;
if (STATES.userAgent.capabilities.touch) { if (STATES.userAgent.capabilities.touch) {
let customList = TouchController.getCustomList(), allGames = sigls["29a81209-df6f-41fd-a528-2ae6b91f719c"].data.products; let customList = TouchController.getCustomList(), allGames = sigls["ce573635-7c18-4d0c-9d68-90b932393470"].data.products;
customList = customList.filter((id2) => allGames.includes(id2)), sigls["9c86f07a-f3e8-45ad-82a0-a1f759597059"]?.data.products.push(...customList); customList = customList.filter((id2) => allGames.includes(id2)), sigls["9c86f07a-f3e8-45ad-82a0-a1f759597059"]?.data.products.push(...customList);
} }
} catch (e) { } catch (e) {
@ -6915,7 +6915,7 @@ function interceptHttpRequests() {
} }
if (STATES.userAgent.capabilities.touch && url.includes("catalog.gamepass.com/sigls/")) { if (STATES.userAgent.capabilities.touch && url.includes("catalog.gamepass.com/sigls/")) {
let response = await NATIVE_FETCH(request, init), obj = await response.clone().json(); let response = await NATIVE_FETCH(request, init), obj = await response.clone().json();
if (url.includes("29a81209-df6f-41fd-a528-2ae6b91f719c")) for (let i = 1;i < obj.length; i++) if (url.includes("ce573635-7c18-4d0c-9d68-90b932393470")) for (let i = 1;i < obj.length; i++)
gamepassAllGames.push(obj[i].id); gamepassAllGames.push(obj[i].id);
else if (url.includes("9c86f07a-f3e8-45ad-82a0-a1f759597059")) try { else if (url.includes("9c86f07a-f3e8-45ad-82a0-a1f759597059")) try {
let customList = TouchController.getCustomList(); let customList = TouchController.getCustomList();

View File

@ -1,5 +1,5 @@
export enum GamePassCloudGallery { export enum GamePassCloudGallery {
ALL = '29a81209-df6f-41fd-a528-2ae6b91f719c', ALL = 'ce573635-7c18-4d0c-9d68-90b932393470',
MOST_POPULAR = 'e7590b22-e299-44db-ae22-25c61405454c', MOST_POPULAR = 'e7590b22-e299-44db-ae22-25c61405454c',
NATIVE_MKB = '8fa264dd-124f-4af3-97e8-596fcdf4b486', NATIVE_MKB = '8fa264dd-124f-4af3-97e8-596fcdf4b486',
TOUCH = '9c86f07a-f3e8-45ad-82a0-a1f759597059', TOUCH = '9c86f07a-f3e8-45ad-82a0-a1f759597059',

View File

@ -942,20 +942,20 @@ if (this.baseStorageKey in window.BX_EXPOSED.overrideSettings) {
// Set Achievements list's filter default to "Locked" // Set Achievements list's filter default to "Locked"
guideAchievementsDefaultLocked(str: string) { guideAchievementsDefaultLocked(str: string) {
let index = str.indexOf('FilterButton-module__container'); let index = str.indexOf('FilterButton-module__container');
index >= 0 && (index = PatcherUtils.lastIndexOf(str, '.All', index, 150)); index >= 0 && (index = PatcherUtils.lastIndexOf(str, '"All"', index, 150));
if (index < 0) { if (index < 0) {
return false; return false;
} }
str = PatcherUtils.replaceWith(str, index, '.All', '.Locked'); str = PatcherUtils.replaceWith(str, index, '"All"', '"Locked"');
index = str.indexOf('"Guide_Achievements_Unlocked_Empty","Guide_Achievements_Locked_Empty"'); index = str.indexOf('"Guide_Achievements_Unlocked_Empty","Guide_Achievements_Locked_Empty"');
index >= 0 && (index = PatcherUtils.indexOf(str, '.All', index, 250)); index >= 0 && (index = PatcherUtils.indexOf(str, '"All"', index, 250));
if (index < 0) { if (index < 0) {
return false; return false;
} }
str = PatcherUtils.replaceWith(str, index, '.All', '.Locked'); str = PatcherUtils.replaceWith(str, index, '"All"', '"Locked"');
return str; return str;
}, },