🔥CSDN优化插件🔥

⚡️CSDN界面功能优化(去除关注展开|去除顶部右上右侧推荐广告|代码折叠展开)⚡️

2023-10-11 يوللانغان نەشرى. ئەڭ يېڭى نەشرىنى كۆرۈش.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         🔥CSDN优化插件🔥
// @namespace    https://github.com/bencky1017/browserplugin/
// @version      0.2.1
// @description  ⚡️CSDN界面功能优化(去除关注展开|去除顶部右上右侧推荐广告|代码折叠展开)⚡️
// @icon         data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAHoklEQVR4Xu1baXBTVRT+7kvTNqUbbbokbcECgwqyM4CK0kIHBCzqICgyOKxCUkBEUP9BnXEcRUSQBmRRR0BRQAYLIigCsowiW6tgEbEIJAHaAk0XuiTvOq8l7cvrS/OWtORH3kx+vXO+893vLu/ec08I2uNZX5aK2rtpoLQShNgwN7WsPcJKiUGkGCmyybNOAsOMBKVTW/pTKwizHpTuhtl4ShG+n5z8L4DF9goA7jdAIsd1YFgL5qQWSLT3q5l/BbBYtwLkBQUMS+FyTcC8tEMKfFW5+E+APNu3IHhOFRuG9MQcw3lVGDKd/SNA3rWpIMxnwthhGoLM1HB0jQlBlxgtymtZ/OdworjCiV+sNWJUq8CQQe0pgnoB1tp7gKVHAMTxW9QtRosFfaPQPzFMtE+2/l2FVQUOkXckH2bDOJkdqdhcvQB5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1w66KPlLB2s1Oo6nw17/O/wfrYNjnZjnpcgAAAABJRU5ErkJggg==
// @author       BenckyC
// @match        *://*.csdn.net/*
// @match        *://huaweicloud.csdn.net/*
// @require      https://cdn.staticfile.org/jquery/3.7.1/jquery.js
// @grant        none
// @license      MIT
// @note         2023-10-12 00:26:10 0.2.1  优化代码展开后类名替换的问题
// @note         2023-10-07 10:23:55 0.2.0  添加华为云开发者联盟自动展开(无需登录可展开)
// @note         2023-09-26 15:22:41 0.1.5  修改展开代码不完全的问题(官方类名修改过)
// ==/UserScript==

(function () {
    window.onload = function () {

        //******************************* CSDN *******************************
        //去除 关注博主即可阅读全文
        $("#article_content").removeAttr("style");
        $(".hide-article-box").remove();
        //允许 未登录复制
        $('#content_views pre,#content_views pre code').css({ '-webkit-user-select': 'auto' }, { 'user-select': ':auto' });
        $('.hljs-button,.signin').attr('data-title', '可复制');
        //去除 顶部广告,右上窗口广告,右侧推荐广告
        $('.toolbar-advert').remove();
        $('.adsbygoogle').remove();
        $('#recommendAdBox').remove()
        // 展开代码框折叠
        $('.set-code-hide').removeClass('set-code-hide').addClass('set-code-show')
        $('.hide-preCode-box').remove();


        //************************* 华为云开发者联盟 *************************
        // 去除华为云开发者联盟“点击阅读全文”按钮
        $('.article-show-more').remove()
        // 取消超过高度隐藏功能,自动完全展开
        $('.user-article-hide').removeClass('user-article-hide')

    };
})();