您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
调整背景护眼颜色、调整文字宽度,双击显示/隐藏顶栏和侧边栏,修改滚动条样式
// ==UserScript== // @name 微信读书小狐自用 // @namespace http://tampermonkey.net/ // @version 1.6 // @description 调整背景护眼颜色、调整文字宽度,双击显示/隐藏顶栏和侧边栏,修改滚动条样式 // @author XiaoHu & GPT // @match https://weread.qq.com/* // @grant none // ==/UserScript== /*顺便云存档自用的脚本,防止丢失*/ /*CSDNGreener*/ /*骚扰拦截*/ /*怠惰小说下载器*/ /*知乎增强*//* X.I.U */ /*知乎美化*//* AN drew */ (function() { 'use strict'; // 更改背景颜色 function changeBackgroundColor() { document.body.style.backgroundColor = "rgba(231, 224, 198, 1)";//背景色调整改这里 const allElements = document.querySelectorAll('*'); allElements.forEach(element => { if (window.getComputedStyle(element).backgroundColor === "rgb(255, 255, 255)") { element.style.backgroundColor = "rgba(231, 224, 198, 1)";//背景色调整改这里 } }); } // 调整文字宽度 function adjustWidth() { const content = document.querySelector(".readerContent .app_content"); if (content) { content.style.width = "95%"; // 宽度调整改这里 content.style.maxWidth = "none"; // 移除最大宽度限制 content.style.margin = "0 auto"; // 居中内容 const paragraphs = content.querySelectorAll("p"); paragraphs.forEach(paragraph => { paragraph.style.maxWidth = "none"; // 确保段落宽度同步调整 }); const resizeEvent = new Event("resize"); window.dispatchEvent(resizeEvent); } } // 修改滚动条颜色 function customizeScrollbar() { const style = document.createElement('style'); style.innerHTML = ` ::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background-color: rgba(240, 235, 220, 1); border-radius: 5px; } ::-webkit-scrollbar-track { background-color: rgba(231, 224, 198, 1); } `; document.head.appendChild(style); } // 隐藏/显示顶栏和侧边栏 function toggleVisibility() { const header = document.querySelector('.readerTopBar'); // 顶栏 const sidebar = document.querySelector('.readerControls'); // 侧边栏 if (header && sidebar) { const isHidden = header.style.display === 'none'; header.style.display = isHidden ? '' : 'none'; sidebar.style.display = isHidden ? '' : 'none'; } } // 双击事件监听 function enableDoubleClickToggle() { document.addEventListener('dblclick', toggleVisibility); } // 初始化脚本功能 function init() { changeBackgroundColor(); adjustWidth(); customizeScrollbar(); enableDoubleClickToggle(); } // 页面加载完成后初始化 window.addEventListener('load', init); })();