Greasy Fork is available in English.

Automatic Material Dark-Mode for YouTube

A low-tech solution to a high-tech problem! Automatically clicks YouTube's "Dark Mode" button if dark mode isn't already active.

< Feedback on Automatic Material Dark-Mode for YouTube

Review: OK - script works, but has bugs

§
Posted: 2020/12/01
Edited: 2020/12/05

Just figured out that this piece of code

document.getElementsByTagName("html")[0].setAttribute("dark", "true");

makes the deal. And you can use:

document.getElementsByTagName("html")[0].removeAttribute("dark");

to switch back to white theme.

Post reply

Sign in to post a reply.