mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-07-31 18:36:44 +02:00
Fix Settings sometimes not being injected to header
This commit is contained in:
6
dist/better-xcloud.user.js
vendored
6
dist/better-xcloud.user.js
vendored
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user