掘金免广告?不想看理财交流圈?不想看exp+8?

最近刷掘金发现很多jy不喜欢看理财交流圈,也看到很多jy也很讨厌exp+8这种无意义的帖子 现贡献一个油猴脚本可以隐藏广告/exp+8/还有屏蔽理财交流圈

免广告部分来自文章 juejin.cn/post/749321...

脚本如下

js 复制代码
       // ==UserScript==
    // @name         掘金插件
    // @namespace    http://tampermonkey.net/
    // @version      2025-08-20
    // @description  去除掘金广告、理财交流圈、exp+类的沸点
    // @author       You
    // @match        https://juejin.cn/*
    // @icon         https://www.google.com/s2/favicons?sz=64&domain=juejin.cn
    // @grant        none
    // ==/UserScript==

    (function() {
        'use strict';
        

        // 1. 去除掘金广告
        const head = document.querySelector('head')
        const style = document.createElement('style')
        style.setAttribute('type', 'text/css')
        style.innerText = `
            .item.hide {
                display: none;
            }
            .top-banners-container,
            .main-area.article-area > article > img {
                display: none !important;
            }
            .view-container .with-global-banner .index-nav-before,
            .view-container .with-global-banner .team-content .list-header.sticky,
            .view-container .with-global-banner .user-view .list-header.sticky,
            .view-container .with-global-banner .view-nav {
                top: 5rem !important;
            }
            .header-with-banner,
            .view-container .with-global-banner .index-nav-before.top,
            .view-container .with-global-banner .team-content .list-header.sticky.top,
            .view-container .with-global-banner .user-view .list-header.sticky.top,
            .view-container .with-global-banner .view-nav.top {
                top: 0 !important;
            }
        `
        head.append(style);
        

        setInterval(() => {
            let items = document.querySelectorAll('.pin-list>.item:not(.hide)');
            items.forEach(item=>{
                let hide = false;
        
                // 2. 判断exp+类的沸点
                let innerText = item.querySelector('.content-box').innerText.trim();
                if(/exp\+\d/i.test(innerText)){
                    console.log('发现:exp+类的沸点', innerText);
                    hide = true;
                }
        
                // 3. 判断理财圈子
                let findClassifyElement = item.querySelector('.club-digg-row a span');

                if(findClassifyElement){
                    let classifyName = findClassifyElement.innerText;
                    if(classifyName.startsWith("理财")){
                        console.log('发现:理财圈子', innerText);
                        hide = true;
                    }
                }
            
        
                if(hide){
                    item.classList.add('hide');
                }
            })
        }, 3000);
    

    })();

添加脚本到油猴然后将上方代码拷贝进去就可以了

相关推荐
爱学习的茄子4 分钟前
Function Call:让AI从文本生成走向智能交互的技术革命
前端·深度学习·openai
aol1216 分钟前
X6官方示例「数据加工DAG图」转为Vue版
前端·vue.js
南雨北斗6 分钟前
vue3 attribute绑定
前端
一枚前端小能手7 分钟前
🚀 主线程卡死用户要骂娘?Web Worker让你的应用丝滑如德芙
前端·javascript
小桥风满袖9 分钟前
极简三分钟ES6 - Promise
前端·javascript
breeze_whisper10 分钟前
当前端收到一个比梦想还大的数字:BigInt处理指南
前端·面试
小喷友11 分钟前
阶段四:实战(项目开发能力)
前端·rust
小高00711 分钟前
性能优化零成本:只加3行代码,FCP从1.8s砍到1.2s
前端·javascript·面试
子兮曰12 分钟前
🌏浏览器硬件API大全:30个颠覆性技术让你重新认识Web开发
前端·javascript·浏览器
即兴小索奇16 分钟前
Google AI Mode 颠覆传统搜索方式,它是有很大可能的
前端·后端·架构