Dark Theme Stackoverflow

Apply stackoverflow dark theme without login

// ==UserScript==
// @name         Dark Theme Stackoverflow
// @description  Apply stackoverflow dark theme without login
// @version      0.2
// @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
// @license      GNU GPLv3
// ==/UserScript==

(function () {
    "use strict";

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