Enables YouTube's built-in Dark theme by default
< 脚本YouTube Dark Theme Enabler的反馈
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
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"?
"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.
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.
Cool if watching Youtube has gotten better for you
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址
seems not work with Tampermonkey + Quantum ?