CSDN屏蔽会员资源

专门屏蔽需要积分才能下载的资源页面以及会员专属资源的页面,让白嫖党在CSDN拥有更舒适的体验

目前为 2021-09-15 提交的版本。查看 最新版本

// ==UserScript==
// @name         CSDN屏蔽会员资源
// @namespace    eyes
// @version      0.1
// @description  专门屏蔽需要积分才能下载的资源页面以及会员专属资源的页面,让白嫖党在CSDN拥有更舒适的体验
// @author       eyes
// @match        *://*.csdn.net/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';
    var loc = location.href;

    // 搜索页面
    var reg = /\/so\/search/g;
    if (reg.test(loc)) {
        // 执行屏蔽
        function shield() {
            var list_item = $('.list-item');
            $.each(list_item, function (i, v) {
                var b = v.getElementsByClassName('icon-download').length;
                if (b && v.style.display != 'none') v.style.display = 'none';
            })
        }

        // 页面加载完毕时执行
        $().ready(function () {
            shield();
        })

        // 页面下滑加载时执行
        $(window).scroll(function () {
            shield();
        })

        // 点击加载更多时执行
        $(".so-load-data").click(function () {
            shield();
        })
    }

    // 文章页面
    var reg2 = /article\/details/g;
    if (reg2.test(loc)) {
        var download_item = $('.recommend-box .type_download');
        var download_item_num = download_item.length;
        $.each(download_item, function (i, v) {
            v.style.display = 'none';
        })
    }
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址