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

    })();

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

相关推荐
chilavert3181 分钟前
技术演进中的开发沉思-258 Ajax:自定义事件
前端·ajax·okhttp
南知意-6 分钟前
从零搭建 Live2D 看板娘教程(自建API避墙版)
服务器·前端·vue.js·开源·博客·美化·看板娘
来杯三花豆奶14 分钟前
Vue 2 中 Store (Vuex) 从入门到精通
前端·javascript·vue.js
Lethehong14 分钟前
React构建实时股票分析系统:蓝耘MaaS平台与DeepSeek-V3.2的集成实践
前端·react.js·前端框架·蓝耘mcp·蓝耘元生代·蓝耘maas
LSL666_16 分钟前
1 验证码
java·服务器·前端·redis·验证码
少油少盐不要辣32 分钟前
前端如何处理AI模型返回的流数据
前端·javascript·人工智能
IT_陈寒34 分钟前
Java21新特性实战:5个杀手级改进让你的开发效率提升40%
前端·人工智能·后端
跟着珅聪学java34 分钟前
以下是使用JavaScript动态拼接数组内容到HTML的多种方法及示例:
开发语言·前端·javascript
BD_Marathon38 分钟前
NPM_配置的补充说明
前端·npm·node.js
巴拉巴拉~~42 分钟前
KMP 算法通用图表组件:KmpChartWidget 多维度可视化 + PMT 表渲染 + 性能对比
前端·javascript·microsoft