Greasy Fork is available in English.

YouTube Dark Theme Enabler

Enables YouTube's built-in Dark theme by default

< Commentaires sur YouTube Dark Theme Enabler

Avis: Bon - le script fonctionne correctement

§
Posté le: 2024-05-07

seems not work with Tampermonkey + Quantum ?

StreampunkAuteur
§
Posté le: 2024-05-08

Tested with current versions of Firefox 125.0.3 and Tempermonkey 5.1.0 on a clean profile and my script works as expected.
Perhaps you have some extensions or scripts that are preventing my script from working properly.
Try turning off the other extensions and scripts for YouTube and check how the script works in that case

§
Posté le: 2024-05-10

Yes, that's a problem with:
u-Youtube
When i disable it, your script work as expected!

Can you make a fix to work with "u-Youtube"?

StreampunkAuteur
§
Posté le: 2024-05-10

"YouTube Dark Theme Enabler" uses Youtube's built-in dark theme, and "u-Youtube" uses its own dark theme that I can't influence in any way.
But you can fix "u-Youtube" script yourself so that it doesn't interfere with the built-in dark Youtube theme. To do this, just comment out the following block of code:
/*if(localStorage.getItem('dark_mode')==1){
if(!document.querySelector("html").hasAttribute("dark")){
document.querySelector("html").setAttribute("dark",true);}
}
else if(document.querySelector("html").hasAttribute("dark"))
{document.querySelector("html").removeAttribute("dark")}*/

Quick test showed that this correction allows "YouTube Dark Theme Enabler" work properly and the functions of "u-Youtube" continue to work fine, just don't use the theme change function.

§
Posté le: 2024-05-10

Thanks for the Tweak!
Work like a charm, as your script.

Your script as the advantage to always enable the Dark theme.

With "u-Youtube", i need to enable it when i open for first time a Youtube page.
With your tweak, it can disable/enable (useful to test Dark or No Dark theme).
And at the refresh, your script re enable it.

StreampunkAuteur
§
Posté le: 2024-05-10

Cool if watching Youtube has gotten better for you

Poster une réponse

Connectez-vous pour poster une réponse.