Greasy Fork

Greasy Fork is available in English.

简书一键净化脚本

清除广告 评论 推荐等,只保留文章和作者.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         简书一键净化脚本
// @namespace    http://tampermonkey.net/
// @description  清除广告 评论 推荐等,只保留文章和作者.
// @author       艾尔蓝德
// @version      1.0.2
// @match        www.jianshu.com/*
// @grant       GM_registerMenuCommand
// ==/UserScript==

/* jshint esversion: 6 */
(function() {
    'use strict';
    const style=document.createElement("style");
	style.setAttribute("type", "text/css")
    style.innerHTML=`
section[aria-label],div[aria-label]:not([aria-label~=给文章点赞]),footer+div {
  display:none
}
`
    document.head.appendChild(style)
    const jian_clear = function(){
        const removeList = [
            'header',
            // 右侧栏
            'div[role*=main] aside',
            // 底部广告
            'div[role*=main] ._gp-ck>section:first-of-type~*',
            // 二维码 关注之类的
            'div[role*=main] article~*',
            // 左侧栏
            '#__next>footer~div',
            // 评论
            '#__next>footer'
        ]
        for(const item of removeList){
            for(const _node of document.querySelectorAll(item)){
                _node.remove()
            }
        }
    }
    GM_registerMenuCommand('一键净化', jian_clear)
})();