Mega.nz Automatic Dark Mode

Make mega.nz and mega.io use dark mode by default.

当前为 2023-02-06 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Mega.nz Automatic Dark Mode
  3. // @match *://*.mega.nz/*
  4. // @match *://*.mega.io/*
  5. // @grant none
  6. // @version 1.1.0
  7. // @author NoUser
  8. // @description Make mega.nz and mega.io use dark mode by default.
  9. // @namespace https://greasyfork.org/en/scripts/459496-mega-nz-automatic-dark-mode
  10. // @homepage https://greasyfork.org/en/scripts/459496-mega-nz-automatic-dark-mode
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. var body = document.getElementsByTagName("body")[0];
  18. if (!body.classList.contains("theme-dark")) {
  19. body.classList.add("theme-dark");
  20. }
  21.  
  22. var style = document.createElement('style');
  23. style.innerHTML = '.mobile { background-color: black !important; color: white !important; } .viewer-bars { background-color: black !important; color: white !important; } .file-name { color: white !important; }';
  24. document.head.appendChild(style);
  25. })();