EasyCNBLOGS

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

Verze ze dne 17. 12. 2023. Zobrazit nejnovější verzi.

  1. // ==UserScript==
  2. // @name EasyCNBLOGS
  3. // @description 这是一款促进博客园极致简洁和高效的插件。免费共享大量创新功能,如:净化页面等。让我们的学习体验无比简洁、专注、高效、畅快。
  4. // @version 2.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. #blog_post_info_block /*隐藏[正文的][底部的]推荐关注*/
  24. {
  25. display: none !important;
  26. }
  27.  
  28. /*隐藏背景*/
  29. html body {
  30. background: none !important;
  31. background-image: unset !important;
  32. background-color: unset !important;
  33. }
  34.  
  35. /*展示全屏*/
  36. body {
  37. margin-left: unset !important;
  38. margin-right: unset !important;
  39. margin-bottom: unset !important;
  40. padding: unset !important;
  41. padding-bottom: unset !important;
  42. display: flex;
  43. justify-content: center;
  44. }
  45. .post {
  46. border: unset !important;
  47. border-bottom-width: unset !important;
  48. border-right-width: unset !important;
  49. padding: unset !important;
  50. margin-bottom: unset !important;
  51. width: 80%;
  52. }
  53.  
  54.  
  55. `;
  56.  
  57. //净化页面
  58. const purifyPage = function() {
  59. GM_addStyle(purify_style_pc);
  60. };
  61.  
  62. //超净化页面
  63. const purifyPageSuper = function() {
  64. const p = $(".post");
  65. $('body').innerHTML = "";
  66. $('body').appendChild(p);
  67. };
  68.  
  69. document.addEventListener("DOMContentLoaded", function() {
  70. purifyPageSuper();
  71. });
  72.  
  73. purifyPage();
  74.  
  75. })();