Greasy Fork

Greasy Fork is available in English.

鸿蒙字体

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

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

// ==UserScript==
// @name 鸿蒙字体
// @namespace 鸿蒙字体
// @version  1.9.3
// @description 在网页中使用华为鸿蒙字体
// @author LWF
// @license MIT
// @grant none
// @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() {
    // 创建一个 <style> 元素
    const css = document.createElement('style');
    
    // 为 <style> 元素设置 CSS 内容,导入外部字体,并强制所有元素使用 HarmonyOS_Medium 字体
    css.innerHTML = "@import url('https://s1.hdslb.com/bfs/static/jinkela/long/font/medium.css');*{font-family:HarmonyOS_Medium!important;}";
    
    // 将 <style> 元素添加到页面的 <head> 部分
    document.head.appendChild(css);
})();