您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Turn on/off dark mode automatically in ani.gamer.com.tw based on the color scheme of OS.
当前为
// ==UserScript== // @name BAHAMUT Auto Dark Mode // @namespace http://tampermonkey.net/ // @version 0.2 // @description Turn on/off dark mode automatically in ani.gamer.com.tw based on the color scheme of OS. // @description:ZH-CN 根据系统配色自动开启/关闭 ani.gamer.com.tw 的深色模式 // @author Jiachen Chen // @match *://ani.gamer.com.tw/* // ==/UserScript== (function () { "use strict"; const htmlTag = document.getElementsByTagName("html")[0]; const lightSwitch = document.getElementById("lightSwitch"); if ( window.matchMedia && window.matchMedia("(prefers-color-scheme: light)").matches ) { if (htmlTag.getAttribute("data-theme") === "dark") { lightSwitch.click(); } } window .matchMedia("(prefers-color-scheme: light)") .addEventListener("change", (e) => { if (htmlTag.getAttribute("data-theme") === "dark") { lightSwitch.click(); } }); if ( window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ) { if (htmlTag.getAttribute("data-theme") === "light") { lightSwitch.click(); } } window .matchMedia("(prefers-color-scheme: dark)") .addEventListener("change", (e) => { if (htmlTag.getAttribute("data-theme") === "light") { lightSwitch.click(); } }); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址