Skip to content

Commit

Permalink
Merge pull request #2226 from raszpl/patch-3
Browse files Browse the repository at this point in the history
Update themes.js 'ytd-masthead') no guaranteed to exists, fixes rando…
  • Loading branch information
ImprovedTube committed Apr 30, 2024
2 parents 29db2fa + b13c773 commit f6b84f3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions js&css/web-accessible/www.youtube.com/themes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand All @@ -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':
Expand Down

0 comments on commit f6b84f3

Please sign in to comment.