默认雅黑字体

修改默认字体为 微软雅黑(Microsoft YaHei)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         默认雅黑字体
// @version      1.3
// @description  修改默认字体为 微软雅黑(Microsoft YaHei)
// @author       QIQI
// @match        *://*/*
// @grant        none
// @run-at       document-start
// @namespace https://greasyfork.org/users/16216
// ==/UserScript==
(function(){
    var prependChild = function(o,s){
        if(s.hasChildNodes()){
            s.insertBefore(o,s.firstChild);
        }else{
            s.appendChild(o);
        }
    };
    var element = document.createElement("link");
    element.rel="stylesheet";
    element.type="text/css";
    element.href="data:text/css,*{font-family:\"Microsoft YaHei\"}";
    if(window.location.href=="http://tool.chinaz.com/regex" || window.location.href=="http://tool.chinaz.com/regex/"){
        element.href+=" #inputText,#inputBg,#searchText,#searchBg,#inputBg *,#searchBg *{font: 100% \"courier new\",monospace;}";
    }else if(window.location.hostname=="tv.daoapp.io" && window.location.search.indexOf("?editor/edit")!=-1){
        element.href+=" .edit_body *{ font-family: Consolas, \"Liberation Mono\", Menlo, Courier, monospace !important;}";
    }
    prependChild(element,document.documentElement);
})();