Reddit Theme Cookie Modifier

Modify the `theme` value inside the cookie so reddit can switch dark mode automatically

Pada tanggal 17 November 2025. Lihat %(latest_version_link).

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Reddit Theme Cookie Modifier
// @namespace    http://tampermonkey.net/
// @version      0.12
// @description  Modify the `theme` value inside the cookie so reddit can switch dark mode automatically
// @author       Orthon Jiang
// @match        *://*.reddit.com/*
// @icon         https://www.reddit.com/favicon.ico
// @grant        none
// @license      MIT
// ==/UserScript==

(function () {
    'use strict';

    function setThemeValue() {
        const cookies = document.cookie.split('; ');
        const themeCookies = cookies.filter(c => c.startsWith('theme='));
        if (themeCookies.length === 0)
            return;
        document.cookie = "theme=0; path=/";
    }
    setThemeValue();
    setInterval(setThemeValue, 2000);
})();