Greasy Fork

来自缓存

隐藏招贤纳士横幅

隐藏PTCHDBits网站上的招贤纳士横幅

// ==UserScript==
// @name         隐藏招贤纳士横幅
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  隐藏PTCHDBits网站上的招贤纳士横幅
// @author       YourName
// @match        https://ptchdbits.co/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // 使用更精确的CSS选择器定位目标元素
    const banner = document.querySelector('div[style*="background:red"][style*="width:320px"] a[href*="topicid=12362"]');

    if (banner) {
        // 向上查找最近的div父元素
        const targetDiv = banner.closest('div');
        if (targetDiv) {
            targetDiv.style.display = 'none';
            // console.log('成功隐藏招贤纳士横幅');
        }
    }

    // 备用方案:直接通过样式特征查找
    const alternativeSearch = document.querySelector('div[style*="background:red"]');
    if (alternativeSearch && alternativeSearch.textContent.includes('招贤纳士')) {
        alternativeSearch.style.display = 'none';
    }
})();