Greasy Fork

Greasy Fork is available in English.

所有站点使用默认字体样式

设置所有网站字体样式:微软雅黑+取消加粗

当前为 2020-03-30 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name              所有站点使用默认字体样式
// @namespace         https://gitub.com/weirick/AllSiteDefaultFont
// @version           1.2.0
// @icon              https://weirick.github.io/storage/font.png
// @description       设置所有网站字体样式:微软雅黑+取消加粗
// @author            RCWei
// @license           GPL-3.0
// @supportURL        https://gitub.com/weirick/AllSiteDefaultFont
// @include             *://*/*
// @noframes
// @run-at            document-start
// @grant             none
// @require           https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js
// ==/UserScript==

;(function () {
  let css = document.createElement('style');
  css.type = 'text/css';
  css.innerHTML="*{font-family:微软雅黑;font-weight:400!important;}a,h1,h2,h3,h4,h5,h6,p,b{font-weight:400!important;}.h1,.h2,.h3,.h4,.h5,.h6,{font-weight:400!important;}";
  document.getElementsByTagName('head').item(0).appendChild(css);
  $('pre,code').css('cssText', 'font-weight:400 !important;font-family:Jetbrains Mono !important');

  let body = document.getElementsByTagName('body')[0];
  body.setAttribute('style','font-weight:400 !important');

  var site = location.host;
  switch (site) {
    case 'github.com':
      $('.h1, .h2, .h3, .h4, .h5, .h6, p, a').css('cssText', 'font-weight:400 !important');
      $('.text-bold').css('cssText', 'font-weight:400 !important');
      break;

    case 'member.bilibili.com':
      $('#app *').css('cssText', 'font-weight:400 !important');
      break;

    default:
  }
})();