移除NodeSeek推广
侧边栏壁纸
  • 累计撰写 105 篇文章
  • 累计收到 59 条评论

移除NodeSeek推广

wszx01
2025-06-08 / 0 评论 / 1 阅读

移除NodeSeek推广

一、论坛扩展里面加入下面的代码就行了

a.promotation-item:not([href*="nodeseek.com"]):not([href*="github.com"]):not([href*="nodequality.com"]) {
    display: none;
}

二、Adguard 推荐抄酒神的作业

nodeseek.com###nsk-right-panel-container > div > a.promotation-item:matches-attr("href"=/^(?!^[^?#]*[nN][oO][dD][eE][sS][eE][eE][kK])(?!^[^?#]*[nN][oO][dD][eE][qQ][uU][aA][lL][iI][tT][yY]).*$/)

三、油猴脚本 推荐抄酒神的作业

// ==UserScript==
// @name         RemoveNodeSeekPromotions
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  移除右侧推广
// @author       malibu
// @match        https://www.nodeseek.com/*
// @grant        none
// @run-at       document-start
// ==/UserScript==

(function() {
    'use strict';


    const removePromotionsByLinkPath = () => {
        const selector = '#nsk-right-panel-container a.promotation-item';
        const adLinks = document.querySelectorAll(selector);

        if (adLinks.length === 0) {
            return;
        }

        adLinks.forEach(link => {
            if (link.style.display === 'none') {
                return; 
            }

            const href = link.getAttribute('href');

            if (!href || href.startsWith('javascript:')) {
                return; 
            }

            try {
                const linkUrl = new URL(href, location.origin);

                const linkPart = (linkUrl.origin + linkUrl.pathname).toLowerCase();

                const shouldKeep = linkPart.includes('nodeseek') || linkPart.includes('nodequality');

                if (!shouldKeep) {
                    link.style.setProperty('display', 'none', 'important');
                }
            } catch (e) {
            }
        });
    };

    const observer = new MutationObserver(removePromotionsByLinkPath);

    observer.observe(document.documentElement, {
        childList: true,
        subtree: true
    });

})();
0

评论 (0)

取消