小说网站阅读优化油猴脚本
经常看小说忍受不了各种排版和广告,模仿了safari阅读模式。
// ==UserScript==
// @name 小说阅读器
// @version 0.4
// @description 美化小说网站界面
// @author Zee Kim
// @match *://www.abcxs.com/book/*/*.html
// @match *://www.abcxs.net/book/*/*.html
// @match *://www.biquge.info/*/*.html*
// @match *://www.zmccx.com/*/*.html
// @match *://www.tycqxs.com/*/*.html
// @grant none
// ==/UserScript==
(function () {
"use strict";
var title = document.querySelector("title").innerHTML;
var content = document.querySelector("#content").innerHTML;
title = title.split("_");
var name = title[1];
title = title[0];
document.title = title;
content = content.split("https://www.abcxs.com");
content = content[0].replace(/ /g, "");
content = content.replace(/(杨开|秦尘|郑凡|郑伯爷|平野伯爷|瞎子北|魔丸|樊力|薛三|风四娘|阿铭|梁程)/g, "<b style='color:var(--active)'>$1</b>");
document.body.innerHTML = `<style>
:root{
--background:#F8F1E3;
--text:#4F321C;
--active:#e44343;
}
@media (prefers-color-scheme: dark) {
:root{
--background:#111;
--text:#878475;
--active:#e2c06b;
}
}
.title{
display:flex;
align-items:center;
}
.name{
display:inline-block;
padding:10px 0px;
font-weight:bold;
font-family:SourceHanSerifCN-Bold,Microsoft JhengHei,STFangsong;
font-size:3.2rem;
line-height:1;
color:var(--text);
}
.section{
margin-left:20px;
position:relative;
display:inline-block;
padding:10px 20px;
font-family:SourceHanSerifCN-Bold,Microsoft JhengHei,STFangsong;
font-size:1.6rem;
line-height:1;
background:var(--active);
color:var(--background);
border-radius:50px;
}
.section::after{
content:"";
position:absolute;
left:-14px;
top:12px;
border:10px solid transparent;
border-right-color:var(--active);
}
</style>
<div class="title">
<span class="name">${name}</span>
<span class="section">${title}</span>
</div>
<br>
${content}`;
document.body.style.cssText =
'font-family: "STYuanti-SC-Regular","幼圆";font-size: 2rem;padding: 6rem;background:var(--background) ;color:var(--text);line-height: 1.5;';
})();
直接安装,为了达到最佳效果请安装思源宋体。
https://greasyfork.org/zh-CN/scripts/424670-%E5%B0%8F%E8%AF%B4%E9%98%85%E8%AF%BB%E5%99%A8
类似的小说网站都可以支持,可自行修改,顺便安利一下自己在看的小说,《武炼巅峰》,《魔临》,《武神主宰》。