diff --git a/js&css/web-accessible/www.youtube.com/player.js b/js&css/web-accessible/www.youtube.com/player.js
index 09324954e..669f702fb 100644
--- a/js&css/web-accessible/www.youtube.com/player.js
+++ b/js&css/web-accessible/www.youtube.com/player.js
@@ -803,6 +803,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");
if (typeof trustedTypes !== 'undefined' && typeof trustedTypes.createPolicy === 'function') {
// Create a Trusted Type policy
const policy = trustedTypes.createPolicy('default', {
@@ -815,11 +816,10 @@ ImprovedTube.playerFitToWinButton = function () {
`);
// Ensure the SVG element is correctly parsed
- const svg = tempContainer.querySelector('svg');
- } else { let tempContainer = document.createElement("div");
- tempContainer.innerHTML = ``;
- const svg = tempContainer.firstChild;}
+ // const svg = tempContainer.querySelector('svg');
+ } else {tempContainer.innerHTML = ``;}
+ const svg = tempContainer.firstChild;
this.createPlayerButton({
id: 'it-fit-to-win-player-button',
child: svg,