Zhihu.com Dark Mode

Enable Zhihu.com Dark Mode Mod

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name                Zhihu.com Dark Mode
// @name:zh-CN          知乎黑暗模式-改
// @name:zh-TW          知乎黑暗模式-改
// @namespace           https://www.zhihu.com/
// @version             0.2
// @description         Enable Zhihu.com Dark Mode Mod
// @description:zh-CN   开启知乎黑暗模式
// @description:zh-TW   开启知乎黑暗模式
// @author              kaka
// @match               *://*.zhihu.com/*
// @license             MIT
// ==/UserScript==

(function () {
    'use strict';
        const ignoreList = [
        'link.zhihu.com',
        'video.zhihu.com',
        'www.zhihu.com/pub/book',
        'www.zhihu.com/tardis',
    ];
 
    const checkURL = (url) => {
        for (const u of ignoreList) {
            if (url.indexOf(u) !== -1) {
                return false
            }
        }
        return true;
    };
 
    if (checkURL(location.href) && !document.cookie.includes('theme=dark')) {
        document.cookie = "theme=dark; path=/; expires=Fri, 31 Dec 9999 23:59:59 GMT; secure; samesite=Lax";
        location.reload();
    }
    
})();