GitHub apply dark theme on private repo

Apply dark theme to your private repository pages on Github

// ==UserScript==
// @name         GitHub apply dark theme on private repo
// @namespace    https://github.com/benok/
// @description  Apply dark theme to your private repository pages on Github
// @include      https://github.com/*
// @version      2022.01.31.0
// @homepage     https://gist.github.com/benok/301f7a9667a598202f10111af054ae77
// @author       benok
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    if (document.querySelector('span.Label.Label--secondary').textContent == "Private") {
        document.querySelector('html').setAttribute('data-color-mode', 'dark');
    }
})();
长期地址
遇到问题?请前往 GitHub 提 Issues。