V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
body007
V2EX  ›  V2EX

移除那些不想看的节点帖子的油猴脚本

  •  
  •   body007 · Jun 12, 2025 · 1476 views
    This topic created in 324 days ago, the information mentioned may be changed or developed.

    由于忽略节点规则是“被忽略的节点中的主题将不会在首页出现”,但我希望翻页后那些节点也不要出现,所以写了下面油猴脚本代码。把代码里面的/go/a/go/b改成不想看的节点就行,还可以添加更多节点。

    // ==UserScript==
    // @name         V2EX 自定义
    // @namespace    http://tampermonkey.net/
    // @version      v0.0.1
    // @description  自定义操作
    // @author       You
    // @match        https://*.v2ex.com/*
    // ==/UserScript==
    
    (function() {
        'use strict';
    
        const elements = document.querySelectorAll('div.cell.item[style=""]');
        elements.forEach((element) => {
            if (element.querySelector('a.node[href="/go/a"], a.node[href="/go/b"]')) {
                element.remove()
            }
        });
    })();
    
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2462 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 07:35 · PVG 15:35 · LAX 00:35 · JFK 03:35
    ♥ Do have faith in what you're doing.