@@ -803,6 +803,7 @@ FIT-TO-WIN BUTTON
803
803
------------------------------------------------------------------------------*/
804
804
ImprovedTube . playerFitToWinButton = function ( ) {
805
805
if ( this . storage . player_fit_to_win_button === true && ( / w a t c h \? / . test ( location . href ) ) ) {
806
+ let tempContainer = document . createElement ( "div" ) ;
806
807
if ( typeof trustedTypes !== 'undefined' && typeof trustedTypes . createPolicy === 'function' ) {
807
808
// Create a Trusted Type policy
808
809
const policy = trustedTypes . createPolicy ( 'default' , {
@@ -815,11 +816,10 @@ ImprovedTube.playerFitToWinButton = function () {
815
816
<path d="M21 3 9 15"/><path d="M12 3H3v18h18v-9"/><path d="M16 3h5v5"/><path d="M14 15H9v-5"/></svg>` ) ;
816
817
817
818
// Ensure the SVG element is correctly parsed
818
- const svg = tempContainer . querySelector ( 'svg' ) ;
819
- } else { let tempContainer = document . createElement ( "div" ) ;
820
- tempContainer . innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" id="ftw-icon">
821
- <path d="M21 3 9 15"/><path d="M12 3H3v18h18v-9"/><path d="M16 3h5v5"/><path d="M14 15H9v-5"/></svg>` ;
822
- const svg = tempContainer . firstChild ; }
819
+ // const svg = tempContainer.querySelector('svg');
820
+ } else { tempContainer . innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" id="ftw-icon">
821
+ <path d="M21 3 9 15"/><path d="M12 3H3v18h18v-9"/><path d="M16 3h5v5"/><path d="M14 15H9v-5"/></svg>` ; }
822
+ const svg = tempContainer . firstChild ;
823
823
this . createPlayerButton ( {
824
824
id : 'it-fit-to-win-player-button' ,
825
825
child : svg ,
0 commit comments