掘金免广告?不想看理财交流圈?不想看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);
    

    })();

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

相关推荐
飞翔的佩奇21 分钟前
【完整源码+数据集+部署教程】【天线&水】舰船战舰检测与分类图像分割系统源码&数据集全套:改进yolo11-repvit
前端·python·yolo·计算机视觉·数据集·yolo11·舰船战舰检测与分类图像分割系统
哆啦A梦15881 小时前
点击Top切换数据
前端·javascript·vue.js
程序猿追2 小时前
Vue组件化开发
前端·html
艾德金的溪2 小时前
redis-7.4.6部署安装
前端·数据库·redis·缓存
小光学长2 小时前
基于Vue的2025年哈尔滨亚冬会志愿者管理系统5zqg6m36(程序+源码+数据库+调试部署+开发环境)带论文文档1万字以上,文末可获取,系统界面在最后面。
前端·数据库·vue.js
@PHARAOH2 小时前
WHAT - 受控组件和非受控组件
前端·javascript·react.js
生莫甲鲁浪戴2 小时前
Android Studio新手开发第二十六天
android·前端·android studio
JH30733 小时前
B/S架构、HTTP协议与Web服务器详解
前端·http·架构
yi碗汤园3 小时前
【超详细】C#自定义工具类-StringHelper
开发语言·前端·unity·c#·游戏引擎
Kevin Wang7274 小时前
解除chrome中http无法录音问题,权限
前端·chrome