您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
根据系统设置自动切换深色模式,深色用的是官方的样式
当前为
// ==UserScript== // @name 微信读书自动深色模式 // @version 1.0.1 // @description 根据系统设置自动切换深色模式,深色用的是官方的样式 // @namespace https://weread.qq.com/ // @match https://weread.qq.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=weread.qq.com // @author bowencool // @license MIT // @homepageURL https://gf.qytechs.cn/scripts/477034 // @supportURL https://github.com/bowencool/Tampermonkey-Scripts/issues // @grant none // ==/UserScript== (function () { "use strict"; async function toggle( isDarkMode = window.matchMedia("(prefers-color-scheme: dark)").matches ) { const currentThemeIsWhite = document.body.classList.contains("wr_whiteTheme"); console.log({ isDarkMode, currentThemeIsWhite }); if (isDarkMode) { if (currentThemeIsWhite) { document.cookie = "wr_theme=dark; path=/; domain=.weread.qq.com;"; if (location.pathname.startsWith("/web/reader")) { // const button = await waitForElementToExist( // ".readerControls_item.dark" // ); // button.click(); location.reload(); } else { document.body.classList.remove("wr_whiteTheme"); } } } else { if (!currentThemeIsWhite) { document.cookie = "wr_theme=white; path=/; domain=.weread.qq.com;"; if (location.pathname.startsWith("/web/reader")) { location.reload(); } else { document.body.classList.add("wr_whiteTheme"); } } } } toggle(); window .matchMedia("(prefers-color-scheme: dark)") .addEventListener("change", (e) => { toggle(e.matches); }); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址