From f2baf87ceb2b65a630f65973f155014b1e70d73c Mon Sep 17 00:00:00 2001 From: ImprovedTube Date: Tue, 3 Sep 2024 12:13:59 +0200 Subject: [PATCH] #2546 --- js&css/web-accessible/www.youtube.com/player.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js&css/web-accessible/www.youtube.com/player.js b/js&css/web-accessible/www.youtube.com/player.js index 669f702fb..dda374798 100644 --- a/js&css/web-accessible/www.youtube.com/player.js +++ b/js&css/web-accessible/www.youtube.com/player.js @@ -804,6 +804,7 @@ FIT-TO-WIN BUTTON ImprovedTube.playerFitToWinButton = function () { if (this.storage.player_fit_to_win_button === true && (/watch\?/.test(location.href))) { let tempContainer = document.createElement("div"); + let svg; if (typeof trustedTypes !== 'undefined' && typeof trustedTypes.createPolicy === 'function') { // Create a Trusted Type policy const policy = trustedTypes.createPolicy('default', { @@ -816,10 +817,10 @@ ImprovedTube.playerFitToWinButton = function () { `); // Ensure the SVG element is correctly parsed - // const svg = tempContainer.querySelector('svg'); + svg = tempContainer.querySelector('svg'); } else {tempContainer.innerHTML = ` - `;} - const svg = tempContainer.firstChild; + `; + svg = tempContainer.firstChild;} this.createPlayerButton({ id: 'it-fit-to-win-player-button', child: svg,