Discord darker dark mode

Report bugs/missing areas at [email protected]

当前为 2020-05-20 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Discord darker dark mode
// @namespace    http://tampermonkey.net/
// @version      0.2.2
// @description  Report bugs/missing areas at [email protected]
// @author       github.com/akuankka128
// @match        *://*/*
// @grant        none
// ==/UserScript==

console.info("Starting injection script");

let d = Date.now();
let injection =
`[class$="comment"] { color: rgba(33,33,33,1) !important; }
[class^="contents-"]>div, [class^="name-"] { color: darkmagenta !important; }
[class^="embedWrapper-"], [class^="grid-"], [class^="searchHeader-"], [class*=categoryWrapper-], div[class^=inspector-] { background-color: rgb(12,12,12) !important; }
[class^="expandedFolderBackground-"], [class^="actionButton-"], [class*="fixClipping-"] { background: rgba(10,10,10, .9) !important; }
[class^=option-]::after, [class^="resultsGroup-"] { background: rgb(11,11,11) !important; }
[class^="scrollableContainer-"] { background: rgba(5,5,5, 1) !important; }
[class^="scroller"], [aria-label="User area"], [class^="form"],[class^="form"]::before, [aria-label="Channel header"], [class^="searchBar"], [class^="spacer-"]::after, header[class^="header-"], [class^="uploadModal-"], [class^="userPopout-"] :nth-child(1), [class^="footer-"] { background: rgba(0,0,0, 1) !important; }
[data-ref-id^="messages"] { font-size: .75rem !important; }
[data-ref-id^="private-channels-"], [class^="uploadModal-"] > div[class^="footer-"], [class^="topSectionNormal-"] > div[class] > div[class^="activity-"], [class^="tabBarContainer-"], textarea[maxlength="256"], [class^="drawerSizingWrapper-"]>*, section[class^="container-"] { background: rgba(7,7,7, 1) !important; }
[class^="headerFill-"] { background: rgba(0,0,0,.95) !important; }
code { background: rgba(12,12,12,1) !important; }
body * { font-family: Consolas, Inconsolata !important; }
[class^="searchHeader"] { background: rgba(2,2,2,.95) !important; }
[class^="resultsGroup"] { background: rgba(0,0,0,.75) !important; }
[class^=option]::after { display:none!important }
[class*="botTagRegular-"] { background:rgba(0,0,0,1)!important; }
div[class*="fullscreenOnMobile-"]>div[class*="alignCenter-"], div[class*="fullscreenOnMobile-"]>div[class*="directionRowReverse-"] { background:rgba(0,0,0,.75)!important; }
[class*=slideBody-]>header[class*=header] { color:rgb(230,230,230)!important; }
[class^="autocompleteInner-"] { background:rgba(0,0,0,.71)!important; }
div[class*=join], div[class*=create] {
	background-color:rgba(12,12,12,.8);
	color:rgb(230,230,230);
}`;

(function() {
    console.info("In main function at " + Date.now());
    'use strict';

    if(!/.*?(www\.)?discord(app)?\.com\/channels\/(@me|\d{17,19})(\/\d{17,19})?/.test(document.location.href)) return console.info(`Did not match a Discord message channel URL. Stopping execution at: ${Date.now()}, execution time: ${Date.now() - d}ms`);

    console.info("Discord message channel URL detected. Proceeding with injection...");
    let injector = document.createElement('style');
    injector.innerHTML = injection;
    console.info("Injection tag made, injecting into HTML content...");

    document.body.appendChild(injector);
    console.info(`Injection completed at ${Date.now()}. Total execution time: ${Date.now() - d}ms`);
})();