invidio_dark_mode.user.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // ==UserScript==
  2. // @name Invidious - Dark Mode
  3. // @version 1.1.7
  4. // @author Jesús E.
  5. // @license GPL version 3 or any later version::: https://www.gnu.org/licenses/gpl-3.0.html
  6. // @description This script automatically toggles dark mode on Invidious and its various public instances.
  7. // @namespace InvidiousDark
  8. // @homepageURL https://git.sr.ht/~heckyel/book/blob/master/scripts-greasemonkey
  9. // @include /^http(s|)://(www[.]|)invidio[.]us/.*$/
  10. // @include /^http(s|)://(www[.]|proxy[.]|)invidious[.]snopyta[.]org/.*$/
  11. // @include /^http(s|)://(www[.]|)vid[.]wxzm[.]sx/.*$/
  12. // @include /^http(s|)://(www[.]|)invidious[.]kabi[.]tk/.*$/
  13. // @include /^http(s|)://(www[.]|)invidiou[.]sh/.*$/
  14. // @include /^http(s|)://(www[.]|)yewtu[.]be/.*$/
  15. // @include /^http(s|)://(www[.]|)invidious[.]ggc-project[.]de/.*$/
  16. // @include /^http(s|)://(www[.]|)invidious[.]enkirton[.]net/.*$/
  17. // @include /^http(s|)://(www[.]|)tube[.]poal[.]co/.*$/
  18. // @include /^http(s|)://(www[.]|)invidious[.]13ad[.]de/.*$/
  19. // @include /^http(s|)://(www[.]|)invidious[.]drycat[.]fr/.*$/
  20. // @grant none
  21. // ==/UserScript==
  22. window.addEventListener('load', () => {
  23. const consoleCSS = 'background: #000; color: #00FF00; padding: 0px 7px; border: 1px solid #00FF00; line-height: 16px;';
  24. const name = GM_info.script.name;
  25. const version = GM_info.script.version;
  26. const log = (...args) => console.log('%cUSERSCRIPT | %s %s | %s', consoleCSS, name, version, ...args);
  27. log('successfully initialized');
  28. let defaultMode = document.getElementsByClassName('ion-ios-moon')[0];
  29. if (defaultMode != null) {
  30. defaultMode.click();
  31. log('Dark theme ready!');
  32. }
  33. });