您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Automatically switch Discord theme based on your system theme.
// ==UserScript== // @name Discord Follows System Theme // @description Automatically switch Discord theme based on your system theme. // @version 1 // @grant none // @match https://discord.com/* // @run-at document-idle // @namespace https://greasyfork.org/users/749016 // ==/UserScript== (async function () { const modules = await getModules(); let updateLocalSettings; for (const module of modules) { if ((updateLocalSettings = module.exports?.default?.updateLocalSettings)) { break; } } const updateTheme = (dark) => { updateLocalSettings({ theme: dark ? "dark" : "light" }); }; const query = matchMedia("(prefers-color-scheme: dark)"); query.addEventListener("change", (event) => { updateTheme(event.matches); }); setTimeout(() => updateTheme(query.matches), 1500); })(); async function getModules() { // ✨✨✨ const uid = Math.random().toString(36).substring(7); return Object.values( ( await new Promise((resolve) => { window.webpackJsonp.push([ [uid], { [uid]: (...args) => resolve(args) }, [[uid]], ]); }) )[2].c ); }