您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
微信读书宽度调整,可加大,减少,方便的调整到想要的宽度
当前为
// ==UserScript== // @name 微信读书加宽度 // @namespace mailto:[email protected] // @version 0.1 // @description 微信读书宽度调整,可加大,减少,方便的调整到想要的宽度 // @author olv // @match https://weread.qq.com/web/reader/* // @grant GM_log // @grant GM_addStyle // ==/UserScript== (function () { 'use strict'; // 基础方法 function getCurrentMaxWidth(element) { let currentValue = window.getComputedStyle(element).maxWidth; currentValue = currentValue.substring(0, currentValue.indexOf('px')); currentValue = parseInt(currentValue); return currentValue; } function changeWidth(increse) { const step = 100; const item = document.querySelector(".readerContent .app_content"); const currentValue = getCurrentMaxWidth(item); let changedValue; if (increse) { changedValue = currentValue + step; } else { changedValue = currentValue - step; } item.style['max-width'] = changedValue + 'px'; const myEvent = new Event('resize'); window.dispatchEvent(myEvent) } // 添加内容 const menus = ` <div style="position:fixed; top:0; right:0; z-index:100"> <button id='lv-button1'>增加宽度</button> <button id='lv-button2'>减小宽度</button> </div> ` const mybody = document.getElementsByTagName('body') mybody[0].insertAdjacentHTML('afterbegin', menus) // 添加样式 GM_addStyle(` #lv-button1, #lv-button2 { border: 1px solid; } `) // 添加监听 document.getElementById('lv-button1').addEventListener('click', () => changeWidth(true)); document.getElementById('lv-button2').addEventListener('click', () => changeWidth(false)); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址