Greasy Fork

Greasy Fork is available in English.

鸿蒙字体

在网页中使用华为鸿蒙字体

目前为 2024-10-06 提交的版本。查看 最新版本

// ==UserScript==
// @name 鸿蒙字体
// @namespace 鸿蒙字体
// @version  1.9.1
// @description 在网页中使用华为鸿蒙字体
// @author LWF
// @license MIT
// @grant GM_addStyle
// @match *
// @exclude *://fanqienovel.com/reader/*
// @exclude *://*.android.google.cn/*
// @exclude *://www.bilibili.com/*
// @exclude *://search.bilibili.com/*
// @exclude *://account.bilibili.com/*
// @exclude *://developer.huawei.com/*
// @exclude *://ai.qaqgpt.com/*
// @run-at document-start
// ==/UserScript==

(function() {
    'use strict';

    // 为了在没有GM_* API上方便添加CSS
    function GM_addStyle(css) {
        const style = document.createElement('style');
        style.type = 'text/css';
        style.appendChild(document.createTextNode(css));
        document.head.appendChild(style);
    }

    // 调用 GM_addStyle 来添加样式
    GM_addStyle(`
        @import url('https://s1.hdslb.com/bfs/static/jinkela/long/font/medium.css');
        * {
            font-family: HarmonyOS_Medium !important;
        }
    `);
})();