Dark Theme Stackoverflow

Apply Stack Overflow dark theme without login

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name               Dark Theme Stackoverflow
// @name:en            Dark Theme Stackoverflow
// @name:zh-CN         Dark Theme Stackoverflow
// @name:zh-TW         Dark Theme Stackoverflow
// @name:id            Dark Theme Stackoverflow
// @name:ja            Dark Theme Stackoverflow
// @name:ko            Dark Theme Stackoverflow
// @name:fr            Dark Theme Stackoverflow
// @name:es            Dark Theme Stackoverflow
// @name:de            Dark Theme Stackoverflow
// @name:ru            Dark Theme Stackoverflow
// @description        Apply Stack Overflow dark theme without login
// @description:en     Apply Stack Overflow dark theme without login
// @description:zh-CN  在未登录的情况下应用 Stack Overflow 暗黑主题
// @description:zh-TW  在未登入的情況下套用 Stack Overflow 深色主題
// @description:id     Terapkan tema gelap Stack Overflow tanpa login
// @description:ja     ログインせずに Stack Overflow のダークテーマを適用します
// @description:ko     로그인하지 않고 Stack Overflow 다크 테마를 적용합니다
// @description:fr     Appliquez le thème sombre de Stack Overflow sans vous connecter
// @description:es     Aplica el tema oscuro de Stack Overflow sin iniciar sesión
// @description:de     Wendet das Dark Theme von Stack Overflow ohne Anmeldung an
// @description:ru     Применяет тёмную тему Stack Overflow без входа в систему
// @version            0.3
// @run-at             document-start
// @match              https://*.stackoverflow.com/*
// @icon               https://stackoverflow.com/favicon.ico
// @author             Fznhq
// @namespace          https://github.com/fznhq
// @homepageURL        https://github.com/fznhq/userscript-collection
// @homepage           https://github.com/fznhq/userscript-collection
// @license            GNU GPLv3
// ==/UserScript==

(function () {
    "use strict";

    new MutationObserver((_, observer) => {
        if (document.body) {
            observer.disconnect();
            document.body.classList.add("theme-dark");
        }
    }).observe(document, { subtree: true, childList: true });
})();