Dark Mode

暗黑模式测试

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Dark Mode
// @name:zh-CN   Dark Mode
// @name:zh-TW   Dark Mode
// @name:en      Dark Mode
// @version      0.2
// @author       Jango
// @description  暗黑模式测试
// @description:zh-CN  暗黑模式测试
// @description:zh-TW  暗黑模式测试
// @description:en  Dark Mode Demo
// @match        *://*/*
// @namespace https://greasyfork.org/users/1255494
// ==/UserScript==


addStyle();

// 添加样式
function addStyle() {
  let remove = false;
  let style_Add = document.createElement('style')
  style_Add.id = 'DarkMode';
  style_Add.type = 'text/css';
     let style = 'html{filter: invert(90%) !important;  text - shadow: 0 0 0!important;  } img, .img, .thumb-overlay-albums canvas, video, [style*="background"][style*="url"], svg{    filter: invert(1) !important;}'
  if (document.lastElementChild) {
    document.lastElementChild.appendChild(style_Add).textContent = style;
  } else {
    let timer1 = setInterval(function () {
      if (document.lastElementChild) {
        clearInterval(timer1);
        document.lastElementChild.appendChild(style_Add).textContent = style;
      }
    });
  }
}