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.

這裡顯示腳本的所有版本。 只顯示彼此間有代碼差異的版本。

  • v1.7.0 2018-03-24 In some browsers (perhaps only Google Chrome), they have now added a 3rd button to YouTube's menu bar; a "Camera with a plus" icon. This update now ensures we can find the settings menu on both 2-button and 3-button bars, so that the automatic dark mode works in YouTube in all browsers again.
  • v1.6.4 2017-11-17 Show a warning to people who are on YouTube's old theme (which doesn't HAVE any dark mode!). This is to avoid "error reports" by people who aren't even on YouTube's new theme.
  • v1.6.3 2017-11-07 Switch function declaration style
  • v1.6.2 2017-11-07 Updated to latest support-libraries, and switched to an even more reliable menu button selector
  • v1.6.1 2017-11-07 Increased element search max timeout from 2 seconds to 6 seconds
  • v1.6.0 2017-11-07 Updated to YouTube's new element name for the Settings-menu button
  • v1.5.0 2017-11-05 Updated dark mode detection since YouTube has changed their site
  • v1.4 2017-09-21
  • v1.4 2017-09-14 Now supports switching theme even when you're logged in to a YouTube account! I never log in so I had no idea that the menus were different. ;-)
  • v1.3 2017-09-13 Rewrote all code to make the theme switching as fast as your browser/YouTube is capable of! The theme-settings menu is now barely visible before it's closed again. :-)
  • v1.2 2017-09-13 Now focuses the search-field after switching to the dark theme, for easier typing
  • v1.1 2017-09-05 Improved the YouTube menu-detection method to a new one that retries when necessary
  • v1.0 2017-09-05