字体替换

字体替换,将页面全部等宽字体替换为Maple Mono NF CN

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

// ==UserScript==
// @name         字体替换
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  字体替换,将页面全部等宽字体替换为Maple Mono NF CN
// @match        *://*/*
// @grant        GM_addStyle
// @license MIT
// ==/UserScript==

const fonts = new Set()
const main = () => {
    let fontFaceCSS = '';
    document.querySelectorAll('*').forEach(node => {
        let nodeFont = getComputedStyle(node).fontFamily
        if (nodeFont.includes('mono')) {
            console.log(node)
            node.style.fontFamily = 'Maple Mono NF CN'
        }
    })
}

main()
setInterval(main, 3000)