From b8efaf96487836f50ddfb3c0121d30907f4355c4 Mon Sep 17 00:00:00 2001 From: redphx <96280+redphx@users.noreply.github.com> Date: Tue, 6 Feb 2024 22:53:53 +0700 Subject: [PATCH] Fix not loading Better xCloud after logging in --- better-xcloud.user.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/better-xcloud.user.js b/better-xcloud.user.js index c700100..1deac52 100644 --- a/better-xcloud.user.js +++ b/better-xcloud.user.js @@ -6,6 +6,7 @@ // @author redphx // @license MIT // @match https://www.xbox.com/*/play* +// @match https://www.xbox.com/*/auth/msa?*loggedIn* // @run-at document-start // @grant none // @updateURL https://raw.githubusercontent.com/redphx/better-xcloud/main/better-xcloud.meta.js @@ -38,6 +39,17 @@ window.NATIVE_MKB_TITLES = [ // '9P731Z4BBCT3', // Atomic Heart ]; +if (window.location.pathname.includes('/auth/msa')) { + window.addEventListener('load', e => { + window.location.search.includes('loggedIn') && setTimeout(() => { + const location = window.location; + location.pathname.includes('/play') && location.reload(true); + }, 2000); + }); + // Stop processing the script + throw new Error('[Better xCloud] Refreshing the page after logging in'); +} + console.log(`[Better xCloud] readyState: ${document.readyState}`); const BxEvent = {