diff --git a/js&css/web-accessible/www.youtube.com/themes.js b/js&css/web-accessible/www.youtube.com/themes.js index 5edcd49d3..b47884788 100644 --- a/js&css/web-accessible/www.youtube.com/themes.js +++ b/js&css/web-accessible/www.youtube.com/themes.js @@ -75,7 +75,9 @@ ImprovedTube.myColors = function () { document.getElementById("cinematics").style.visibility = 'hidden'; document.getElementById("cinematics").style.display = 'none !important'; } - document.querySelector('ytd-masthead').style.backgroundColor = ''+primary_color+''; + if (document.querySelector('ytd-masthead')) { + document.querySelector('ytd-masthead').style.backgroundColor = ''+primary_color+''; + } } else { //theoretically this will never be called this.elements.my_colors?.remove(); } @@ -94,7 +96,9 @@ let darkCookie; document.getElementById('cinematics').style.display = 'none !important'; } this.elements.my_colors?.remove(); - document.querySelector('ytd-masthead').style.backgroundColor ='#000'; + if (document.querySelector('ytd-masthead')) { + document.querySelector('ytd-masthead').style.backgroundColor ='#000'; + } break case 'default':