Greasy Fork 支持简体中文。

西子湖畔样式加重

西子湖畔网站字重加粗

// ==UserScript==
// @name         西子湖畔样式加重
// @namespace    https://bbs.xizi.com/
// @version      1.0
// @description  西子湖畔网站字重加粗
// @author       XiaoMao
// @match        https://bbs.xizi.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=xizi.com
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    // 定义一个函数来设置 <a> 标签的字体加粗
    function setBoldFont() {
        const links = document.querySelectorAll('a');
        links.forEach(link => {
            link.style.setProperty('font-weight', 'bold', 'important');
        });
    }

    // 初始化时先执行一次
    setBoldFont();

    // 使用 MutationObserver 监听 DOM 变化
    const observer = new MutationObserver(() => {
        setBoldFont();
    });

    // 开始监听整个文档的变化
    observer.observe(document.body, {
        childList: true, // 监听子节点的添加或删除
        subtree: true    // 监听所有后代节点
    });
})();