使用serif字体

安卓手机一般使用的是Sans Serif字体,偶尔使用下Serif字体也不错

  1. // ==UserScript==
  2. // @name 使用serif字体
  3. // @namespace https://greasyfork.org/
  4. // @version 240906.18
  5. // @description 安卓手机一般使用的是Sans Serif字体,偶尔使用下Serif字体也不错
  6. // @author You
  7. // @license MIT
  8. // @run-at document-end
  9. // @match *://*/*
  10. // @grant GM_addStyle
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. /*
  16. *想要网页的字体统一点,可把body改成*,用body意在多样性。节点特定字体,不会生效
  17. *font-size 字体大小
  18. *font-weight 字体粗细
  19. */
  20.  
  21. GM_addStyle(`body{font-weight:650;font-family:serif}`);
  22.  
  23. /*非手机网页加大字体*/
  24. document.body.scrollWidth>768&&GM_addStyle(`body{font-size:${parseFloat(getComputedStyle(document.body).fontSize)*1.77}px}`);
  25.  
  26. })();