您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
去掉span的内联字体样式,删除部分小说的多余换行。
当前为
// ==UserScript== // @name 真白萌新站阅读体验优化 // @namespace mashiro_me // @version 0.2 // @description 去掉span的内联字体样式,删除部分小说的多余换行。 // @author MikaRyu // @match https://masiro.me/admin/novelReading* // @icon https://www.google.com/s2/favicons?domain=masiro.me // @grant none // ==/UserScript== (function() { 'use strict'; var baseBox = document.getElementsByClassName("box-body nvl-content")[0]; var spans = baseBox.getElementsByTagName("span"); for(var i = 0;i<spans.length;i++){ spans[i].style.fontFamily = null; spans[i].style.fontSize = null; } DeleteEmpty(baseBox); DeleteBrs(baseBox); })(); function DeleteEmpty(parent){ var childs = parent.childNodes; var tagName, innerText; for(var i = 0; i < childs.length; i++){ tagName = childs[i].localName; if (tagName == "br"){ continue; } innerText = childs[i].innerHTML; if (typeof(innerText) == "undefined"){ innerText = childs[i].data; } if ((/^( |\s)*$/g.test(innerText)) || ((! childs[i].hasChildNodes()) && typeof(tagName) != "undefined")){ parent.removeChild(childs[i]); i -= 1; continue; } DeleteEmpty(childs[i]); } } function DeleteBrs(parent){ var j = 0; var childs = parent.childNodes; var tagName; for(var i = 0; i < childs.length; i++){ tagName = childs[i].localName; if (tagName == "br"){ if( j == 3 ){ parent.removeChild(childs[i]); i -= 1; }else{ j += 1; } continue; } j = 0; if (childs[i].hasChildNodes()){ DeleteBrs(childs[i]); } } }