diff --git a/dist/better-xcloud.user.js b/dist/better-xcloud.user.js index 403dbc4..8e0c09c 100644 --- a/dist/better-xcloud.user.js +++ b/dist/better-xcloud.user.js @@ -5746,12 +5746,12 @@ class HeaderSection { HeaderSection.#$remotePlayBtn.classList.remove("bx-gone"); } static watchHeader() { - const $header = document.querySelector("#PageContent header"); - if (!$header) + let $root = document.querySelector("#PageContent header") || document.querySelector("#root"); + if (!$root) return; HeaderSection.#observer && HeaderSection.#observer.disconnect(), HeaderSection.#observer = new MutationObserver((mutationList) => { HeaderSection.#timeout && clearTimeout(HeaderSection.#timeout), HeaderSection.#timeout = window.setTimeout(HeaderSection.checkHeader, 2000); - }), HeaderSection.#observer.observe($header, { subtree: !0, childList: !0 }), HeaderSection.checkHeader(); + }), HeaderSection.#observer.observe($root, { subtree: !0, childList: !0 }), HeaderSection.checkHeader(); } } diff --git a/src/index.ts b/src/index.ts index 99d31cc..8de711f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -116,7 +116,7 @@ document.addEventListener('readystatechange', e => { // Preload Remote Play getPref(PrefKey.REMOTE_PLAY_ENABLED) && RemotePlay.preload(); } else { - // Show Settings button in the header when not signed + // Show Settings button in the header when not signed in HeaderSection.watchHeader(); } diff --git a/src/modules/ui/header.ts b/src/modules/ui/header.ts index c26a15f..fa4b815 100644 --- a/src/modules/ui/header.ts +++ b/src/modules/ui/header.ts @@ -68,8 +68,8 @@ export class HeaderSection { } static watchHeader() { - const $header = document.querySelector('#PageContent header'); - if (!$header) { + let $root = document.querySelector('#PageContent header') || document.querySelector('#root'); + if (!$root) { return; } @@ -78,7 +78,7 @@ export class HeaderSection { HeaderSection.#timeout && clearTimeout(HeaderSection.#timeout); HeaderSection.#timeout = window.setTimeout(HeaderSection.checkHeader, 2000); }); - HeaderSection.#observer.observe($header, {subtree: true, childList: true}); + HeaderSection.#observer.observe($root, {subtree: true, childList: true}); HeaderSection.checkHeader(); }