// ==UserScript== // @name Circle 补充粗糙阅读模式|持续更新 // @namespace https://github.com/CandyTek // @version 1.2 // @license MIT // @description Circle 阅读助手有很多未适配的文章网页,使用简单的方法对这些网页进行处理,开启粗糙的信纸阅读模式 // @author CandyTek // @match *://*/* // @icon data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAtOTYwIDk2MCA5NjAiIHdpZHRoPSIyNHB4IiBmaWxsPSIjMDAwMDAwIj48cGF0aCBkPSJNNTYwLTU2NHYtNjhxMzMtMTQgNjcuNS0yMXQ3Mi41LTdxMjYgMCA1MSA0dDQ5IDEwdjY0cS0yNC05LTQ4LjUtMTMuNVQ3MDAtNjAwcS0zOCAwLTczIDkuNVQ1NjAtNTY0Wm0wIDIyMHYtNjhxMzMtMTQgNjcuNS0yMXQ3Mi41LTdxMjYgMCA1MSA0dDQ5IDEwdjY0cS0yNC05LTQ4LjUtMTMuNVQ3MDAtMzgwcS0zOCAwLTczIDl0LTY3IDI3Wm0wLTExMHYtNjhxMzMtMTQgNjcuNS0yMXQ3Mi41LTdxMjYgMCA1MSA0dDQ5IDEwdjY0cS0yNC05LTQ4LjUtMTMuNVQ3MDAtNDkwcS0zOCAwLTczIDkuNVQ1NjAtNDU0Wk0yNjAtMzIwcTQ3IDAgOTEuNSAxMC41VDQ0MC0yNzh2LTM5NHEtNDEtMjQtODctMzZ0LTkzLTEycS0zNiAwLTcxLjUgN1QxMjAtNjkydjM5NnEzNS0xMiA2OS41LTE4dDcwLjUtNlptMjYwIDQycTQ0LTIxIDg4LjUtMzEuNVQ3MDAtMzIwcTM2IDAgNzAuNSA2dDY5LjUgMTh2LTM5NnEtMzMtMTQtNjguNS0yMXQtNzEuNS03cS00NyAwLTkzIDEydC04NyAzNnYzOTRabS00MCAxMThxLTQ4LTM4LTEwNC01OXQtMTE2LTIxcS00MiAwLTgyLjUgMTFUMTAwLTE5OHEtMjEgMTEtNDAuNS0xVDQwLTIzNHYtNDgycTAtMTEgNS41LTIxVDYyLTc1MnE0Ni0yNCA5Ni0zNnQxMDItMTJxNTggMCAxMTMuNSAxNVQ0ODAtNzQwcTUxLTMwIDEwNi41LTQ1VDcwMC04MDBxNTIgMCAxMDIgMTJ0OTYgMzZxMTEgNSAxNi41IDE1dDUuNSAyMXY0ODJxMCAyMy0xOS41IDM1dC00MC41IDFxLTM3LTIwLTc3LjUtMzFUNzAwLTI0MHEtNjAgMC0xMTYgMjF0LTEwNCA1OVpNMjgwLTQ5NFoiLz48L3N2Zz4= // @grant GM_addStyle // @grant GM_registerMenuCommand // @grant GM_getValue // @grant GM_setValue // @run-at document-end // @downloadURL none // ==/UserScript== // ██ 注意 注意 ██:在本脚本 设置>通用>运行时期 里选择 document-end 以获得更好的体验 // ██ 注意 注意 ██:在本脚本 设置>通用>运行时期 里选择 document-end 以获得更好的体验 // 网站规则列表 const myMatchWebsites = [ { // https://www.douban.com/group/topic/233172019/?_i=483527186Jrxqa,498503986Jrxqa match: ["*://www.douban.com/group/topic/*"], header:".nav,.global-nav", article: ["#topic-content",".article > ul"], title:".article > h1", noArticleWidth: "", noArticlePadding: "", }, { // https://www.ximalaya.com/sound/654833787/720357314 match: ["*://www.ximalaya.com/sound/*"], header:"header", article: [".layout-main"], title:".title-wrapper", }, { // https://web.shobserver.com/wx/detail.do?id=751736 // https://www.jfdaily.com/wx/detail.do?id=751736 match: ["*://web.shobserver.com/wx/*","*://www.jfdaily.com/wx/*"], header:".xiazai-top", article: [".news-container"], title:".news-title", }, { // https://www.dxy.cn/bbs/newweb/pc/post/8168102 match: ["*://www.dxy.cn/bbs/newweb/pc/post/*"], header:"header", article: [".threadWrap___qgo9d>div"], title:".title___2fLXg>span", noArticleWidth: "", noArticlePadding: "", delay:2000, }, { // https://www.mafengwo.cn/wenda/detail-13960453.html match: ["*://www.mafengwo.cn/wenda/*"], header:".topBar,.hide", article: [".col-main"], title:".q-title>h1", float: ".fixed", }, { // https://bbs.chinauos.com/zh/post/13120 match: ["*://bbs.chinauos.com/zh/post/*"], header:"app-header-nav-pc", article: [".comment"], title:".pot_title", noArticleWidth: "", noArticlePadding: "", }, { // https://bbs.deepin.org/post/258516 match: ["*://bbs.deepin.org/post/*"], header:"app-header-nav-pc", article: [".comment"], title:".pot_title", noArticleWidth: "", noArticlePadding: "", }, { // https://iask.sina.com.cn/jx/sh/4Q7EpdkHqONF.html match: ["*://iask.sina.com.cn/jx/*"], header:".header-search-bar", article: [".detail-quesion",".detail-answer"], title:".quesion-title", noArticlePadding: "", }, { // https://www.92sucai.com/soft/517280.html match: ["*://www.92sucai.com/soft/*"], header:"#header", article: ["#dcont"], title:"h1.articleTitle", noArticleWidth: "", noArticlePadding: "", }, { // https://download.csdn.net/blog/column/12443431/133098225 match: ["*://download.csdn.net/blog/*"], header:"#csdn-toolbar", article: [".blog-column-content-paper"], noArticleWidth: "", noArticlePadding: "", title:"h1.articleTitle", }, { // https://my.oschina.net/emacs_7348206/blog/11428459 match: ["*://my.oschina.net/emacs_*"], header:".small-header-box__wrapper", article: [".article-box"], noArticleWidth: "", noArticlePadding: "", title:".article-box__title > a", }, { // https://answers.microsoft.com/zh-hans/windows/forum/all/win10%E7%B3%BB%E7%BB%9F%E9%94%81%E5%B1%8F%E5%90%8E/d7e4722d-829a-4d5c-968d-57469f9850d3 match: ["*://answers.microsoft.com/*"], header:"#headerArea", article: ["#threadQuestion","#threadBottomSection"], noArticleWidth: "", title:"#threadQuestionTitleStatusIcons", }, { // https://consumer.huawei.com/cn/support/content/zh-cn15787876/ match: ["*://consumer.huawei.com/cn/support/content/*"], header:"div.header", article: ["#jd-content"], title:"#knowledgeTitle", }, { // https://segmentfault.com/q/1010000043164166/a-1020000043164170 match: ["*://segmentfault.com/q/*"], header:"#sf-header", article: [".card-body",".answer-area"], noArticleWidth: "", noArticlePadding: "", title:"h1.h2 > a.text-body", }, { // https://www.gznf.net/story/4049.html match: ["*://www.gznf.net/story/*"], header:"#header", article: ["div.post"], noArticleWidth: "", noArticlePadding: "", title:"h1.title", }, { // https://edu.iask.sina.com.cn/jy/2qDBNm37OvB.html match: ["*://edu.iask.sina.com.cn/jy/*","*://iask.sina.com.cn/jxwd/*"], header:".header-search-bar", article: [".detail-answer",".detail-quesion"], noArticleWidth: "", noArticlePadding: "", title:"h1.quesion-title", }, { // https://m.qqtn.com/q/93260 match: ["*://m.qqtn.com/q/*"], article: [".g-down-introd"], }, { // http://www.kkx.net/soft/10714.html match: ["*://www.kkx.net/soft/*"], article: [".slidetxtbox"], title:".infobox_centre >h2", noArticleWidth: "", noArticlePadding: "", morehide:".fixed,.details_right", }, { // https://news.hbtv.com.cn/p/2506327.html match: ["*://news.hbtv.com.cn/p/*"], article: ["#main_article"], header:"#header", title:"#article_title", float:".article-sidebar", noArticleWidth: "", noArticlePadding: "", }, { // https://www.jiqizhixin.com/articles/2024-08-12-5 match: ["*://www.jiqizhixin.com/articles/*"], article: ["div.u-container"], header:"div.header__container", title:".article__title", float:".article-sidebar", }, { // https://xinzhi.wenda.so.com/a/1674098957206346 match: ["*://xinzhi.wenda.so.com/a/*"], article: ["div.article"], header:"div.so-nav-container,#login-part,.mod-search", title:"h1.art-title", }, { // https://m.iask.sina.com.cn/b/newPZUEY7vfB2X.html match: ["*://m.iask.sina.com.cn/b/*"], article: [".knowledge-list-switch"], header:".m-baidu-header", title:".m-b-question-title", }, { // https://www.onlinedown.net/soft/621941.htm?t=1567095937624 match: ["*://www.onlinedown.net/soft/*"], article: [".soft-info "], morehide:".m-con-right", noArticleWidth: "", noArticlePadding: "", header:".g-header", }, { // https://soft.3dmgame.com/down/213325.html match: ["*://soft.3dmgame.com/down/*"], article: [".inforwarp "], morehide:".ContR", noArticleWidth: "", noArticlePadding: "", header:"div.header_wrap", }, { // https://m.itmop.com/downinfo/307458.html match: ["*://m.itmop.com/downinfo/*"], article: [".intro "], morehide:".mainContentRight ", header:"header.top,nav", }, { // https://patch.ali213.net/showpatch/180241.html match: ["*://patch.ali213.net/showpatch/*"], article: [".pluginIntroduceContaienr "], noArticleWidth: "", noArticlePadding: "", morehide:".mainContentRight ", header:".ns_t1,.headerPartTopContainer,.headerPartBottomContainer,.gameNavContainer,.softmodclass", }, { // https://mydown.yesky.com/pcsoft/413563730.html match: ["*://mydown.yesky.com/pcsoft/*"], article: [".software_introduction "], noArticleWidth: "", noArticlePadding: "", morehide:".main_right", header:"header", title:"div.name>h1", }, { // https://stackoverflow.com/questions/8162837/curl-downloaded-files-always-empty match: ["*://stackoverflow.com/questions/*"], article: ["#mainbar"], noArticleWidth: "", noArticlePadding: "", title: "#question-header>h1>a", }, { // http://123.56.139.157:8082/article/23/5375563/detail.html match: ["*://123.56.139.157:8082/article/*"], article: [".resource "], noArticleWidth: "", noArticlePadding: "", title: ".content-p>h2", header: ".nav", morehide:".answer-cont-rig", }, { // https://licai.cofool.com/ask/qa_3456365.html match: ["*://licai.cofool.com/ask/*"], article: [".question-result-tab"], noArticleWidth: "", noArticlePadding: "", title: ".answer-detail-title", header: ".new-header,#fixPara", morehide:".answer-cont-rig", }, { // https://www.360docs.net/doc/8814029631.html match: ["*://www.360docs.net/doc/*"], article: [".doc-bg"], noArticleWidth: "", noArticlePadding: "", title: ".doc-h1", header: "#headerbg,div.nav", morehide:"#rightcol", }, { // https://www.renrendoc.com/paper/203766892.html match: ["*://www.renrendoc.com/paper/*","*://www.renrendoc.com/p-*"], article: [".center-wrap"], noArticleWidth: "", noArticlePadding: "", title: "div.titletop>h1", header: "#header-fixed", morehide:".left-wrap", }, { // https://www.saoniuhuo.com/question/detail-2336397.html match: "*://www.saoniuhuo.com/question/*", article: [".discuss-topic",".js-comment-list"], noArticleWidth: "", noArticlePadding: "", title: "h1.discuss-title", header: ".klg-header", morehide:".klg-right-area", }, { // https://ost.51cto.com/posts/1789 match: "*://ost.51cto.com/posts/*", article: ["div.posts-con","#commentbox"], noArticleWidth: "", noArticlePadding: "", title: "div.title>h1", header: "div.topbox", morehide:"div.right", }, { // https://www.5axxw.com/questions/content/bkyx86 match: "*://www.5axxw.com/questions/*", article: [".border-0"], noArticleWidth: "", noArticlePadding: "", title: "h1>a.text-body", header: "#question-header", }, { // https://www.zhihu.com/pin/1710688506907803648 match: "*://www.zhihu.com/pin/*", article: ["div.RichContent"], noArticleWidth: "", header: "header", }, { // https://www.ximalaya.com/ask/q1535994 match: "*://www.ximalaya.com/ask/*", article: ["div.answer-wrapper"], header: "header", noArticleWidth: "", title: "h1.rL_", morehide:".layout-side.rL_", }, { // https://m.ximalaya.com/ask/q6424983 match: "*://m.ximalaya.com/ask/*", article: ["div.answer-wrapper"], header: "div.xm-header", title: "h1.S_q", }, { // https://easylearn.baidu.com/edu-page/tiangong/questiondetail?id=1763409915028681805&fr=search match: "*://easylearn.baidu.com/edu-page/*", article: ["div.shiti-answer"], header: "div#c-header", title: "h1.title-info", noArticleWidth: "", noArticlePadding: "", delay: 1000, morehide:"div.right", }, { // https://m.sohu.com/a/525390351_120176023 match: "*://m.sohu.com/a/*", article: ["div.article-content-wrapper"], header: "div.top-header-container", title: "h1.title-info", }, { // https://liulanmi.com/zt/13557.html match: "*://liulanmi.com/zt/*", article: ["article.article-content","header.article-header"], header: "header.header", title: ".article-title > a", noArticleWidth: "", morehide:".sidebar", }, { // https://www.xinglinpukang.com/ask/95515667.html match: "*://www.xinglinpukang.com/ask/*", article: "div.question", title: "div.question_detial>.title", header: "div.pub-header", noArticleWidth: "", noArticlePadding: "", morehide:"div.right", }, { // https://m.weibo.cn/status/J6IkQmAwE match: "*://m.weibo.cn/status/*", article: "div.main", noArticleBg: "", noArticleWidth: "", noArticlePadding: "", delay: 1000, }, { // https://www.docin.com/p-1793709372.html match: "*://www.docin.com/p-*", article: "#contentcontainer", title: "span.doc_title", header: "div.head_wrapper", noArticleBg: "", noArticleWidth: "", noArticlePadding: "", float: ".relative_doc_fixed_sider,.backToTop", delay: 1000, morehide:".aside", }, { // https://max.book118.com/html/2018/0412/161305776.shtm match: "*://max.book118.com/html/*", article: "div.preview-bd", title: "div.title>h1", header: "div.header", noArticleWidth: "", noArticlePadding: "", float: "#sidebar", clearBg:["#footer"], morehide:".side", }, { // https://weibo.com/3909143892/J6IkQmAwE match: "*://weibo.com/*", article: "article", noArticleWidth: "", noArticlePadding: "", delay: 1000, }, { // http://m.chynews.cn/jiaoyu/2022/1219/52529.html match: "*://m.chynews.cn/*", article: "section.ymw-contxt", header: "header.ymw-header", title: "aside>h1", }, { // https://www.thepaper.cn/newsDetail_forward_28220107 match: "*://www.thepaper.cn/newsDetail*", article: "div.index_wrapper__L_zqV", header: "div.index_headerfixed__GyBYK", }, { // https://content-static.cctvnews.cctv.com/snow-book/index.html?item_id=881584799583221388&track_id=7da808cf-38d5-4d85-8d72-46853a41a930 match: "*://content-static.cctvnews.cctv.com/*", article: "div.container", delay: 1000, }, { // https://wap.zol.com.cn/ask/x_25323627.html match: "*://wap.zol.com.cn/ask/*", article: [".discuss-list.page-space", "#main-wrapper"], title: "div.header-txt>h1", header: "header.global-page-header,body>img:nth-child(1)", }, { // https://ask.zol.com.cn/x/15235157.html match: "*://ask.zol.com.cn/*", article: "div.left", title: "div.title", header: "div.top-bar,div.nav-headerbox", // 相关问题,侧边微信 hide: "div.standing,.side-weixin-box", noArticlePadding: "", }, { // https://wenda.so.com/q/1694788635218092 match: "*://wenda.so.com/q/*", article: ["div#answer", "div.question"], title: "span.question-title-txt", header: "div.main-nav,div.search,div.fixed-nav,div.so-nav-container", morehide:".sidebar", }, { // https://heb.bendibao.com/live/2019225/51379.shtm match: "*://*.bendibao.com/live/*", article: ["div.article-content"], title: "span.question-title-txt", header: "div.main-search,ul.main-nav,div.header", // 右侧栏,左侧分享 hide: ".main-right,.main-catalog.nav-fixed" }, { // https://bbs.csdn.net/topics/300125211 match: "*://bbs.csdn.net/topics/*", article: ["div.detail-container"], title: ".align-items-center>h1", header: ".ccloud-tool-bar", float: ".user-right-floor", noArticleWidth: "", noArticlePadding: "", morehide:".right-box", }, { // https://github.com/AiuniAI/Unique3D match: "*://github.com/*", article: [".iGmlUb", ".comment "], noArticleWidth: "", noArticlePadding: "", noPageBg: "", }, { // https://wenku.csdn.net/column/522m4fc9gr match: "*://wenku.csdn.net/column/*", article: ["div.p-r"], header: "#csdn-toolbar", title: "div.header > .title", float: ".column-vote-panel,.right-bar-box,", noArticleWidth: "", noArticlePadding: "", morehide:".layout-right,.fixed-bottom", }, { // https://worktile.com/kb/ask/1229207.html match: "*://worktile.com/kb/*", article: ["div#answer"], header: "div.top-news,header.header", title: ".q-content .q-title", float: ".action.action-pos-1", noArticleWidth: "", noArticlePadding: "", morehide:".sidebar,div.action", }, ]; /** 设置项 */ const myPreferenceList = [ { type: "number", tooltip: true, tooltipText: "设置为 0 时,使用默认值", text: "宽度", preference: "article_width", defaultValue: 0, }, { type: "number", tooltip: false, text: "阴影大小", preference: "article_shadow_size", defaultValue: 45, }, { type: "number", tooltip: false, text: "标题字体大小", preference: "article_title_fontsize", defaultValue: 35, }, { type: "checkbox", tooltip: false, text: "隐藏网页顶栏", preference: "article_hide_topbar", defaultValue: false, }, { type: "number", tooltip: false, text: "文章内边距大小", preference: "article_padding_size", defaultValue: 40, }, { type: "color", tooltip: true, tooltipText: "设置为 0 时不生效", text: "文章背景颜色", preference: "article_bg_color", defaultValue: "#FFFFFF", }, { type: "color", tooltip: true, tooltipText: "设置为 0 时不生效", text: "网页背景颜色", preference: "webpage_bg_color", defaultValue: "#EDEDED", }, { type: "textarea", tooltip: false, text: "自定义 CSS", preference: "page_custom_css", defaultValue: "", }, ]; /** 设置工具类 */ class CandyTekPreferenceUtil { /** 是否已向网页添加过设置面板了 */ isAlreadyAddSettingPanel = false; /** 设置面板根元素 */ rootShadow = null; /** 存放设置值的地方。获取 prefValues[key] */ prefValues; /** 源 pref 配置数组 */ preferenceList; constructor(preferenceList) { this.preferenceList = preferenceList; this.refreshPrefValues(); } /** 刷新设置值 */ refreshPrefValues() { this.prefValues = this.preferenceList.reduce((list, curr) => { list[curr.preference] = GM_getValue(curr.preference, curr.defaultValue); return list; }, {}); } /** 获取设置值 */ get(key) { return this.prefValues.hasOwnProperty(key) ? this.prefValues[key] : GM_getValue(key, ""); } /** 写入设置值,未适配 boolean */ set(key, value) { GM_setValue(key, value); this.prefValues[key] = value; } /** 显示设置面板在网页右上角 */ show() { if (this.isAlreadyAddSettingPanel) { this.rootShadow.querySelector(".setting_panel").style.display = "block"; return; } if (!document.body.createShadowRoot) { console.warn("可能不能创建 ShadowRoot"); //return; } // 创建设置面板 const host = document.createElement('div'); host.id = "simplify_article_settings_panel"; document.body.appendChild(host); const root = host.attachShadow({ mode: 'open' }); this.rootShadow = root; this.isAlreadyAddSettingPanel = true; root.innerHTML = `
设置