CSDN download

download csdn page clearly!

Fra 19.01.2025. Se den seneste versjonen.

  1. // ==UserScript==
  2. // @name CSDN download
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0.1
  5. // @description download csdn page clearly!
  6. // @author youguess
  7. // @include *://blog.csdn.net/*
  8. // @include *://www.cnblogs.com/*
  9. // @icon https://img-home.csdnimg.cn/images/20201124032511.png
  10. // @grant none
  11. // @license Apache-2.0
  12. // ==/UserScript==
  13.  
  14. var download = (function () {
  15. 'use strict';
  16.  
  17. // Your code here...、
  18. // get url to identify the page
  19. let url = window.location.href;
  20. // alert(url);
  21.  
  22. function removeElementsForCSDN() {
  23. $("#side").remove();
  24. $("#comment_title, #comment_list, #comment_bar, #comment_form, .announce, #ad_cen, #ad_bot").remove();
  25. $(".nav_top_2011, #header, #navigator").remove();
  26. $(".p4course_target, .comment-box, .recommend-box, #csdn-toolbar, #tool-box").remove();
  27. $("aside").remove();
  28. $(".tool-box").remove();
  29. $("#toolBarBox").remove();
  30. $("main").css('display', 'content');
  31. $("main").css('float', 'left');
  32. $(".option-box").remove();
  33. $("body").css('min-width', 0);
  34. $(".option-box").remove();
  35. $("#copyright-box").remove();
  36. $("#blogExtensionBox").remove();
  37. $("#toolbarBox").remove();
  38. var right_content = document.getElementById("rightAsideConcision");
  39. if (right_content != null && right_content.length > 0) {
  40. right_content.remove();
  41. }
  42. var main_content = document.getElementsByClassName("blog-content-box");
  43. if (main_content.length > 0) {
  44. main_content[0].style.margin = "0 auto";
  45. main_content[0].style.maxWidth = "1000px";
  46. }
  47.  
  48. }
  49. function removeElementsForCnblogs() {
  50. $("#navigator").remove();
  51. $("#cnblogs_ch").remove();
  52. $("#under_post_card2").remove();
  53. $("#under_post_card1").remove();
  54. $(".esa-catalog-contents").remove();
  55. $(".aplayer-body, #ap").remove();
  56. $("#scrollInfo").remove();
  57. $("#footer").remove();
  58. $(".login_tips").remove();
  59. $("#blog_c1").remove();
  60. $("#blog_post_info").remove();
  61. $(".postDesc").remove();
  62. $("#blog_post_info_block").remove();
  63. }
  64.  
  65. if (url.match("/.*?csdn\.net*?/")) {
  66. // alert("csdn");
  67. window.onload = removeElementsForCSDN();
  68. }
  69. if (url.match("/.*?cnblogs.*?/")) {
  70.  
  71. // alert("cnblogs");
  72. window.onload = removeElementsForCnblogs();
  73. }
  74.  
  75.  
  76. })();