前端工程师,来自吉林延边。这里是会记录一些自己的闲散笔记。欢迎加V(zeekim2020)交流!

阅读 124 作者 zee

经常看小说忍受不了各种排版和广告,模仿了safari阅读模式。顺便安利一下作者默默小说《武炼巅峰》

支持笔趣阁和ABC小说

// ==UserScript==
// @name         小说阅读器
// @version      0.2
// @description  美化小说网站界面
// @author       Zee Kim
// @match        https://www.abcxs.com/book/*/*.html
// @match        https://www.biquge.info/*/*.html
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    setTimeout(function(){
        window.ondblclick=document.onmousedown=function(){
            return false;
        }
    },1000)

    var title=document.querySelector("title").innerHTML;
    var content=document.querySelector("#content").innerHTML;
    var chapter="";
    document.querySelectorAll(".page_chapter li").forEach(function(v,k){

        if(k==0 || k==2){
            chapter+=v.innerHTML.replace("<a","<a style='display:inline-block;background:#4F321C;color:#fff;font-size:1rem;margin:1rem;padding:0.5rem 2rem;border-radius:50px'");
        }
    });
    console.log(chapter);
    title=title.split('_');
    title=title[0];
    document.title=title;
    title=title.replace(" ","<br>");
    content=content.split('https://www.abcxs.com');
    content=content[0].replace(/&nbsp;/g,"");
    content=content.replace(/杨开/g,"<b>杨开</b>");
    document.body.innerHTML="<h1 style='font-weight:bold;font-family:SourceHanSerifCN-Bold,Microsoft JhengHei,STFangsong'>"+title+"</h1><br><br>"+content+"<div style='margin-bottom:1rem;text-align:center;'>"+chapter+"<div>";
    document.body.style.cssText='font-family: "幼圆";font-size: 2rem;padding: 6rem;background: #F8F1E3;color: #4F321C;line-height: 1.5;';

})();
[编辑于 2020/09/14 13:27]