Skip to content

Commit

Permalink
only setting youtube's dark theme cookie once #2076 ( #2075 #2096 #2084
Browse files Browse the repository at this point in the history
  • Loading branch information
ImprovedTube authored Apr 1, 2024
1 parent fce7e5c commit b80b77f
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions js&css/web-accessible/www.youtube.com/themes.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
/*------------------------------------------------------------------------------
4.3.0 THEMES
------------------------------------------------------------------------------*/

ImprovedTube.setTheme = function () {
let darkCookie;

switch(this.storage.theme) {
case 'custom':
if (Array.isArray(this.storage.theme_primary_color) && Array.isArray(this.storage.theme_text_color)) {
ImprovedTube.myColors = function () {
if ( this.storage.theme === 'custom' && Array.isArray(this.storage.theme_primary_color) && Array.isArray(this.storage.theme_text_color)) {
var style = this.elements.my_colors || document.createElement('style'),
primary_color = this.storage.theme_primary_color,
text_color = this.storage.theme_text_color;
Expand Down Expand Up @@ -81,8 +76,12 @@ ImprovedTube.setTheme = function () {
} else { //theoretically this will never be called
this.elements.my_colors?.remove();
}
break
}


ImprovedTube.setTheme = function () {
switch(this.storage.theme) {
let darkCookie;
case 'black':
case 'dark':
darkCookie = true;
Expand Down

0 comments on commit b80b77f

Please sign in to comment.