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.

< 腳本Automatic Material Dark-Mode for YouTube的回應

評論:普通 - 腳本能使用,但有一些問題

§
發表於:2020-12-01
編輯: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.

發表回覆

登入以回覆