From 9e1d8866ce023b4d8f15928fb9c71e1083d6182c Mon Sep 17 00:00:00 2001 From: redphx <96280+redphx@users.noreply.github.com> Date: Sun, 15 Oct 2023 14:23:08 +0700 Subject: [PATCH] Fix minor bugs in StreamMenu --- better-xcloud.user.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/better-xcloud.user.js b/better-xcloud.user.js index 3eb122a..99cc972 100644 --- a/better-xcloud.user.js +++ b/better-xcloud.user.js @@ -4524,7 +4524,7 @@ function injectStreamMenuButtons() { } // Get the second last button - const $orgButton = node.querySelector('div > div > button:nth-last-child(2)'); + const $orgButton = node.querySelector('div[class^=StreamMenu] > div > button:nth-last-child(2)'); if (!$orgButton) { return; } @@ -4539,7 +4539,7 @@ function injectStreamMenuButtons() { $quickBar.setAttribute('data-clarity-boost', (msVideoProcessing && msVideoProcessing !== 'default')); // Close HUD - $btnCloseHud.click(); + $btnCloseHud && $btnCloseHud.click(); // Show Quick settings bar $quickBar.style.display = 'flex'; @@ -4556,7 +4556,7 @@ function injectStreamMenuButtons() { // Hide Quick bar when closing HUD const $btnCloseHud = document.querySelector('button[class*=StreamMenu-module__backButton]'); - $btnCloseHud.addEventListener('click', e => { + $btnCloseHud && $btnCloseHud.addEventListener('click', e => { $quickBar.style.display = 'none'; }); @@ -4567,7 +4567,7 @@ function injectStreamMenuButtons() { e.stopPropagation(); // Close HUD - $btnCloseHud.click(); + $btnCloseHud && $btnCloseHud.click(); // Toggle Stream Stats StreamStats.toggle(); });