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.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

作者
SteveJobzniak
今日安裝
0
安裝總數
4,145
評價
21 2 1
版本
1.7.0
建立日期
2017-09-05
更新日期
2018-03-24
尺寸
10.4 KB
授權條款
https://www.apache.org/licenses/LICENSE-2.0
腳本執行於

What is this?

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

You must already have YouTube's material theme (you can opt-in at http://youtube.com/new). This script automates the job of enabling "Dark Mode" when necessary.

Why!?

Every time I reset my browser's cache/cookies, I was faced with a white YouTube theme again, and I was tired of switching to Dark Mode manually. This script automates it in a pretty funny way: It automatically opens the Settings menu and clicks the Dark Mode button. Why such a low-tech solution? Because YouTube's page is very advanced and doesn't easily allow 3rd party scripts to switch its settings. There is a more advanced technique commented-out in this code, which actually uses YouTube's internal Event system to signal the change, but I disabled that code because it was much less reliable than the low-tech solution. It's still in this script's source code if anyone is curious, though.

This script is fully compatible with my similar script, Automatic Privacy Reminder Killer for YouTube.

Donate a beer?

Totally optional. ;-)

  • Paypal Paypal: Donate
  • btc Bitcoin: 18XF1EmrkpYi4fqkR2XcHkcJxuTMYG4bcv

Future compatibility?

The script hardcodes the name and location of the menu items it clicks, so there's a very big chance that it'll stop working within a few years (whenever YouTube changes their design again). If it breaks, do NOT freak out and blast this page with negative reviews. Instead, be patient and wait while I update it when I have time. If you ungratefully blast me with negative reviews due to YouTube suddenly changing their design (which isn't my fault), then I won't bother updating this script for you at all.

Enjoy! ;-)