微信读书电脑版更改字体

编程知识 更新时间:2023-04-19 14:28:48

微信读书电脑版,在网页上看书比手机上看舒服多了。最近又租校色仪校了一下显示器的色彩。只是微信读书 PC 版只能改字体大小,不能更改字体。于是写了一个 Tampermonkey 脚本,更改了几行 CSS,前景色和背景色参照 iBooks,字体也设定为楷体加粗。Mac OS + Firefox + Tampermonkey 测试通过。

// ==UserScript==
// @name         WeRead
// @namespace    http://tampermonkey/
// @version      0.1
// @description  try to take over the world!
// @author       Lonely
// @match        https://weread.qq/web/reader/*
// @grant        GM_addStyle
// ==/UserScript==

GM_addStyle("*{font-family: Kaiti,STKaiti,FangSong, SimSun; !important;}");
GM_addStyle(".readerTopBar{font-family: SourceHanSerifCN-Bold !important;}");
GM_addStyle(".bookInfo_title{font-family: SourceHanSerifCN-Bold !important;}");
GM_addStyle(".readerTopBar_title_link{font-family: SourceHanSerifCN-Bold; !important; font-weight:bold !important;}");
GM_addStyle(".readerTopBar_title_chapter{font-family: SourceHanSerifCN-Bold !important;}");
GM_addStyle(".wr_whiteTheme .renderTargetContainer .renderTargetContent .wr_readerImage_opacity {background-color: rgba(249,243,232,100) !important;}");
GM_addStyle(".wr_whiteTheme .renderTargetContainer .renderTargetContent .wr_readerBackground_opacity{background-color: rgba(249,243,232,100) !important;}");
GM_addStyle(".wr_readerBackground_opacity, .wr_readerImage_opacity {opacity: 0.2 !important;}");
GM_addStyle(".wr_whiteTheme .readerContent .app_content{background-color: rgba(249,243,232,100) !important;}");
GM_addStyle(".readerChapterContent{color: rgba(94,64,40,100) !important;}");
GM_addStyle(".readerChapterContent{font-weight: bold !important;}");

(function() {
    'use strict';

    // Your code here...
})();

2021-08-05 修改版

// ==UserScript==
// @name         WeRead
// @namespace    http://tampermonkey/
// @version      0.1
// @description  try to take over the world!
// @author       Lonely
// @match        https://weread.qq/web/reader/*
// @grant        GM_addStyle
// ==/UserScript==

/* 字体 */
GM_addStyle("*{font-family: '方正宋三简体',FZS3JW,SourceHanSerifCN-Medium,Kaiti,STKaiti,FangSong, SimSun; !important;}");

/* app_content */
GM_addStyle(".app_content{padding:0,100; !important;}");

/* 顶部工具栏 */
GM_addStyle(".readerTopBar{max-width:100%; font-family: SourceHanSerifCN-Bold !important;}");
/* 书标题 */
GM_addStyle(".readerTopBar_title .readerTopBar_title_link{font-family: SourceHanSerifCN-Bold; !important; font-weight:bold !important;}");
/* 当前章节标题 */
GM_addStyle(".readerTopBar_title .readerTopBar_title_chapter{font-family: SourceHanSerifCN-Bold !important;}");
/* 去书架查看 */
GM_addStyle(".readerTopBar_actions .addShelfItem{font-family: SourceHanSerifCN-Bold !important;}");




/* 背影色 */
GM_addStyle(".wr_whiteTheme .renderTargetContainer .renderTargetContent .wr_readerImage_opacity {background-color: rgba(249,243,232,100) !important;}");
GM_addStyle(".wr_whiteTheme .renderTargetContainer .renderTargetContent .wr_readerBackground_opacity{background-color: rgba(249,243,232,100) !important;}");
GM_addStyle(".wr_readerBackground_opacity, .wr_readerImage_opacity {opacity: 0.2 !important;}");
/* 配图不透明度 边框 */
GM_addStyle("img.wr_readerImage_opacity {opacity: 1.0 !important;border:5px solid #ccc; margin:5px; padding:5px;}");

GM_addStyle(".wr_whiteTheme .readerContent .app_content{background-color: rgba(249,243,232,100) !important;}");
GM_addStyle(".readerChapterContent{color: rgba(94,64,40,100) !important;}");
GM_addStyle(".readerChapterContent{font-weight: normal !important;}");

/* 笔记 */
GM_addStyle(".readerNotePanel .selectionListItem{border:5px solid  #f00; font-family: '方正聚珍新仿简体';!important;}");

/* 目录 */
GM_addStyle(".readerCatalog h2.readerCatalog_bookInfo_title .readerCatalog_bookInfo_title_txt{font-family: '方正聚珍新仿简体',SourceHanSerifCN-Bold !important;}");
GM_addStyle(".readerCatalog ul.readerCatalog_list li.chapterItem span.chapterItem_text{font-family: '方正聚珍新仿简体',SourceHanSerifCN-Light !important;}");
GM_addStyle(".readerCatalog ul.readerCatalog_list li.chapterItem_current{border:5px solid #ccc; font-family: '方正聚珍新仿简体',SourceHanSerifCN-Bold !important;}");
GM_addStyle(".readerCatalog ul.readerCatalog_list li.chapterItem_current span.chapterItem_text{font-family: '方正聚珍新仿简体',SourceHanSerifCN-Bold !important;}");

/* 下一页 */
GM_addStyle(".readerFooter .readerFooter_button {font-family: SourceHanSerifCN-Bold !important;}");

(function() {
    'use strict';

    /* 100% 宽度 */
    //document.getElementsByClassName("app_content")[0].style.width="100%";
    //document.getElementsByClassName("app_content")[0].style.maxWidth="100%";

    /* 顶部工具条 想要让它左右各有 100 的 margin 或 padding 但总不成功*/
    //document.getElementsByClassName("readerTopbar")[0].style.width="100%";
    //document.getElementsByClassName("readerTopbar")[0].style.maxWidth="100%";

    /* 内容容器 */
    //document.getElementsByClassName("renderTargetContainer")[0].style.width="100%";
    //document.getElementsByClassName("renderTargetContainer")[0].style.maxWidth="100%";

    /* 内容 */
    //document.getElementsByClassName("renderTargetContent")[0].style.width="100%";
    //document.getElementsByClassName("renderTargetContent")[0].style.maxWidth="100%";

})();

更多推荐

微信读书电脑版更改字体

本文发布于:2023-04-15 07:58:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/d4095f72b10bffc17b0e83630fa80605.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字体   电脑

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!

  • 77803文章数
  • 14阅读数
  • 0评论数