默认雅黑字体

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

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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);
})();