NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name Jianshu Ad Blocker 简书去广告界面清洁工具 // @icon https://www.jianshu.com/favicon.ico // @namespace https://dizy.cc/ // @version 0.2.18 // @license MIT // @description 让简书更加简单,干净去除广告、下载App链接。支持移动端网页。Block ads on jianshu.com // @author Dizy // @copyright 2021, Dizy (https://openuserjs.org/users/Dizy) // @updateURL https://openuserjs.org/meta/Dizy/Jianshu_Ad_Blocker_简书去广告界面清洁工具.meta.js // @downloadURL https://openuserjs.org/install/Dizy/Jianshu_Ad_Blocker_简书去广告界面清洁工具.user.js // @match https://www.jianshu.com/* // @require tampermonkey://vendor/jquery.js // @require https://gist.github.com/raw/2625891/waitForKeyElements.js // @grant unsafeWindow // @grant GM_addStyle // ==/UserScript== /*global $*/ /*global waitForKeyElements*/ /*jshint esversion: 6 */ (function () { let removalClassNames = []; function removeDownloadAppAds() { $("a:contains('下载APP')").remove(); $("div:contains('更多精彩内容下载简书APP'):not(:has(> div)):not(.author-desc)").parent().remove(); $("div:contains('小礼物走一走,来简书关注我'):not(:has(> div)):not(.author-desc)").parent().remove(); $("span[aria-label='简书钻']:not(:has(> span))").remove(); if (window.location.pathname.startsWith('/p/')) { $("div:contains('下载App'):not(:has(> div))").parent().remove(); } $("div.logo-wrap").html(`<a href="/">${$("div.logo-wrap").html()}</a>`); $("header").find("div > a:contains('抽奖')").parent().remove(); $("header").find("div > div:contains('抽奖'):not(:has(> div))").parent().remove(); $("nav").find("div > a:contains('抽奖')").parent().remove(); $("nav").find("div > div:contains('抽奖'):not(:has(> div))").parent().remove(); $("div[aria-label='3rd-ad']").remove(); $("div[aria-label='xingchen-ad']").remove(); $("section[aria-label='xingchen-ad']").css('display', 'none'); $("section[aria-label='thirdparty-ad']").css('display', 'none'); $("div.fa8byxiLG1y_kbW7CHjYk_0").remove(); $("div.KSzoIa-mask").parent().parent().remove(); } function dynamicallyRemoveAds() { removeDownloadAppAds(); } // Styling method GM_addStyle(` ${removalClassNames.length ? removalClassNames.join(',') + ',' : ''} a.self-flow-ad, a#web-nav-app-download-btn, div.icp, div.user-daily-banner, a#index-aside-download-qrbox, div.collapse-tips, .show-content-free:after, .collapse-free-content:after, button.call-app-btn, div.recommend-novels-trending, div.slogan, span.slogan, div.header-download, div.download-guide, #homepage > .modal, button.download { display: none !important; visibility: hidden; } div.recommended-author-wrap { margin-top: 10px; } div.col-xs-17.main { margin-bottom: 10px; } div.collapse-free-content { height: auto !important; } `); dynamicallyRemoveAds(); waitForKeyElements("div:contains('更多精彩内容下载简书APP')", dynamicallyRemoveAds); waitForKeyElements("div:contains('小礼物走一走,来简书关注我')", dynamicallyRemoveAds); waitForKeyElements("div:contains('添加新评论')", dynamicallyRemoveAds); })();