EasyCNBLOGS

这是一款促进博客园极致简洁和高效的插件。免费共享大量创新功能,如:净化页面等。让我们的学习体验无比简洁、专注、高效、畅快。

As of 2023-12-17. See the latest version.

  1. // ==UserScript==
  2. // @name EasyCNBLOGS
  3. // @description 这是一款促进博客园极致简洁和高效的插件。免费共享大量创新功能,如:净化页面等。让我们的学习体验无比简洁、专注、高效、畅快。
  4. // @version 3.0
  5. // @author xcanwin
  6. // @namespace https://github.com/xcanwin/EasyCNBLOGS/
  7. // @supportURL https://github.com/xcanwin/EasyCNBLOGS/
  8. // @license GPL-2.0-only
  9. // @match *://www.cnblogs.com/*/p/*.html
  10. // @match *://www.cnblogs.com/*/archive/*.html
  11. // @grant GM_addStyle
  12. // @run-at document-start
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. 'use strict';
  17.  
  18. const $ = (Selector, el) => (el || document).querySelector(Selector);
  19. const $$ = (Selector, el) => (el || document).querySelectorAll(Selector);
  20.  
  21. /*电脑端净化样式*/
  22. const purify_style_pc = `
  23. .postTitle /*隐藏[正文的][顶部的]原标题*/,
  24. #blog_post_info_block /*隐藏[正文的][底部的]推荐关注*/
  25. {
  26. display: none !important;
  27. }
  28.  
  29. /*隐藏背景*/
  30. html body {
  31. background: none !important;
  32. background-image: unset !important;
  33. background-color: unset !important;
  34. }
  35.  
  36. /*展示全屏*/
  37. body {
  38. margin-left: unset !important;
  39. margin-right: unset !important;
  40. margin-bottom: unset !important;
  41. padding: unset !important;
  42. padding-bottom: unset !important;
  43. display: flex;
  44. justify-content: center;
  45. }
  46. .post {
  47. border: unset !important;
  48. border-bottom-width: unset !important;
  49. border-right-width: unset !important;
  50. padding: unset !important;
  51. margin-bottom: unset !important;
  52. width: 80%;
  53. }
  54. .postText {
  55. padding-right: unset !important;
  56. padding-left: unset !important;
  57. padding-bottom: unset !important;
  58. padding-top: unset !important;
  59. }
  60.  
  61. /*调整标题*/
  62. span[role="heading"] {
  63. display: flex;
  64. justify-content: center;
  65. margin-top: 35px !important;
  66. margin-bottom: 20px !important;
  67. color: black !important;
  68. font-size: 33px !important;
  69. font-family: 'PingFang SC','Microsoft YaHei','SimHei','Arial','SimSun';
  70. }
  71. `;
  72.  
  73. //净化页面
  74. const purifyPage = function() {
  75. GM_addStyle(purify_style_pc);
  76. };
  77.  
  78. //超净化页面
  79. const purifyPageSuper = function() {
  80. const p = $(".post");
  81. $('body').innerHTML = "";
  82. $('body').appendChild(p);
  83. };
  84.  
  85. //调整标题
  86. const beautyTitle = function() {
  87. $('.post').insertBefore($('span[role="heading"]'), $('.post').childNodes[0]);
  88. };
  89.  
  90. document.addEventListener("DOMContentLoaded", function() {
  91. purifyPageSuper();
  92. beautyTitle();
  93. });
  94.  
  95. purifyPage();
  96.  
  97. })();