Skip to content

Instantly share code, notes, and snippets.

@maoyeedy
Last active April 9, 2025 09:23
Show Gist options
  • Save maoyeedy/54f661a02121ab84c7c02b7124480c3c to your computer and use it in GitHub Desktop.
Save maoyeedy/54f661a02121ab84c7c02b7124480c3c to your computer and use it in GitHub Desktop.
[Userscript] Override font to 'HarmonyOS Sans SC' for Chinese sites
// ==UserScript==
// @name Change Font to HarmonyOS Sans SC
// @namespace https://github.com/Maoyeedy
// @grant GM_addStyle
// @version 1.1
// @author Maoyeedy
// @description Override font to 'HarmonyOS Sans SC' for Chinese sites
// @match *://*.nate.com/*
// @match *://*.huya.com/*
// @match *://*.douyu.com/*
// @match *://*.smzdm.com/*
// @match *://*.jd.com/*
// @match *://*.taobao.com/*
// @match *://*.tmall.com/*
// @match *://*.zhihu.com/*
// @match *://*.chiphell.com/*
// @match *://*.v2ex.com/*
// @match *://*.baidu.com/*
// @match *://*.qq.com/*
// @match *://*.163.com/*
// @match *://*.weibo.com/*
// @match *://*.gcores.com/*
// @match *://*.zhihuishu.com/*
// @match *://*.gitee.com/*
// @match *://*.sohu.com/*
// @match *://*.sina.com/*
// @match *://*.pinduoduo.com/*
// @match *://*.meituan.com/*
// @match *://*.36kr.com/*
// @match *://*.csdn.net/*
// @match *://*.douban.com/*
// @match *://*.jianshu.com/*
// @match *://*.lagou.com/*
// @match *://*.qunar.com/*
// @match *://*.dianping.com/*
// @match *://*.cn/*
// @run-at document-start
// ==/UserScript==
(function () {
'use strict'
const fontFamily = "'HarmonyOS Sans SC', sans-serif"
GM_addStyle(`
body,
div:not(pre):not(pre *),
span:not(pre):not(pre *),
p,
h1,
h2,
h3,
h4,
h5,
h6,
input,
textarea,
option,
button,
label,
td,
th,
a,
article,
section,
header,
footer,
nav,
strong,
em,
li,
ul,
ol,
blockquote,
cite,
time,
figcaption,
small,
details,
summary,
figure,
caption {
font-family: ${fontFamily} !important;
}
`)
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment