// ==UserScript== // @name 隐藏招贤纳士横幅 // @namespace http://tampermonkey.net/ // @version 1.1 // @description 隐藏PTCHDBits网站上的招贤纳士横幅 // @author YourName // @match https://ptchdbits.co/* // @grant none // @downloadURL https://update.greasyfork.icu/scripts/526488/%E9%9A%90%E8%97%8F%E6%8B%9B%E8%B4%A4%E7%BA%B3%E5%A3%AB%E6%A8%AA%E5%B9%85.user.js // @updateURL https://update.greasyfork.icu/scripts/526488/%E9%9A%90%E8%97%8F%E6%8B%9B%E8%B4%A4%E7%BA%B3%E5%A3%AB%E6%A8%AA%E5%B9%85.meta.js // ==/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'; } })();