Greasy Fork

Greasy Fork is available in English.

网页字体替换微软雅黑并加阴影

网页字体替换成微软雅黑并加上阴影

当前为 2018-04-23 提交的版本,查看 最新版本

// ==UserScript==
// @name     网页字体替换微软雅黑并加阴影
// @namespace  https://stray.love
// @description 网页字体替换成微软雅黑并加上阴影
// @include        *:*
// @author        天涼好個秋
// @homepage  https://stray.love/wen-ti-jie-jue-fang-an/jie-jue-windows-zi-ti-wen-tityles.org
// @version       0.1
// ==/UserScript==
(function() {
    var css=["*:not([class*='icon']):not(i){font-family: 'Microsoft YaHei','iconfont','FontAwesome'  !important;}",
             "*{text-shadow: 0.01em 0.01em 0.01em #999999 !important;}"
            ].join("\n");
    if (typeof GM_addStyle !="undefined") {
        GM_addStyle(css);
    }
    else if (typeof PRO_addStyle !="undefined") {
        PRO_addStyle(css);
    }
    else if (typeof addStyle !="undefined") {
        addStyle(css);
    }
    else {
        var node=document.createElement("style");
        node.type="text/css";
        node.appendChild(document.createTextNode(css));
        var heads=document.getElementsByTagName("head");
        if (heads.length > 0) {
            heads[0].appendChild(node);
        }
        else {
            // no head yet, stick it whereever
            document.documentElement.appendChild(node);
        }
    }
}
)();