CSDN tools

download csdn page clearly!

Stan na 19-01-2025. Zobacz najnowsza wersja.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         CSDN tools
// @namespace    http://tampermonkey.net/
// @version      1.0.0
// @description  download csdn page clearly!
// @author       youguess
// @include        *://blog.csdn.net/*
// @include        *://www.cnblogs.com/*
// @icon         https://img-home.csdnimg.cn/images/20201124032511.png
// @grant        none
// @license      Apache-2.0
// ==/UserScript==

var download = (function () {
    'use strict';

    // Your code here...、
    // get url to identify the page
    let url = window.location.href;
    // alert(url);
    var code_expand_buttons = document.querySelectorAll(".look-more-preCode");
    code_expand_buttons.forEach(
        function(button) {
            button.click();
        }
    )

    function removeElementsForCSDN(){
        $("#side").remove();
            $("#comment_title, #comment_list, #comment_bar, #comment_form, .announce, #ad_cen, #ad_bot").remove();
            $(".nav_top_2011, #header, #navigator").remove();
            $(".p4course_target, .comment-box, .recommend-box, #csdn-toolbar, #tool-box").remove();
            $("aside").remove();
            $(".tool-box").remove();
            $("#toolBarBox").remove();
            $("main").css('display', 'content');
            $("main").css('float', 'left');
            $(".option-box").remove();
            $("body").css('min-width', 0);
            $(".option-box").remove();
            $("#copyright-box").remove();
            $("#blogExtensionBox").remove();
            $("#toolbarBox").remove();
    }
    function removeElementsForCnblogs(){
        $("#navigator").remove();
            $("#cnblogs_ch").remove();
            $("#under_post_card2").remove();
            $("#under_post_card1").remove();
            $(".esa-catalog-contents").remove();
            $(".aplayer-body, #ap").remove();
            $("#scrollInfo").remove();
            $("#footer").remove();
            $(".login_tips").remove();
            $("#blog_c1").remove();
            $("#blog_post_info").remove();
            $(".postDesc").remove();
            $("#blog_post_info_block").remove();
    }

    if (url.match("/.*?csdn\.net*?/")) {
        // alert("csdn");
        window.onload = removeElementsForCSDN();
    }
    if(url.match("/.*?cnblogs.*?/")){

        // alert("cnblogs");
        window.onload = removeElementsForCnblogs();
    }


})();