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

    })();

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

相关推荐
夜郎king24 分钟前
HTML5 SVG 实现日出日落动画与实时天气可视化
前端·html5·svg 日出日落
夏幻灵1 小时前
HTML5里最常用的十大标签
前端·html·html5
Mr Xu_2 小时前
Vue 3 中 watch 的使用详解:监听响应式数据变化的利器
前端·javascript·vue.js
未来龙皇小蓝2 小时前
RBAC前端架构-01:项目初始化
前端·架构
程序员agions2 小时前
2026年,微前端终于“死“了
前端·状态模式
万岳科技系统开发2 小时前
食堂采购系统源码库存扣减算法与并发控制实现详解
java·前端·数据库·算法
程序员猫哥_2 小时前
HTML 生成网页工具推荐:从手写代码到 AI 自动生成网页的进化路径
前端·人工智能·html
龙飞052 小时前
Systemd -systemctl - journalctl 速查表:服务管理 + 日志排障
linux·运维·前端·chrome·systemctl·journalctl
我爱加班、、2 小时前
Websocket能携带token过去后端吗
前端·后端·websocket
AAA阿giao2 小时前
从零拆解一个 React + TypeScript 的 TodoList:模块化、数据流与工程实践
前端·react.js·ui·typescript·前端框架