💊 jb51-clear

脚本之家/jb51清理美化插件

  1. // ==UserScript==
  2. // @name 💊 jb51-clear
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description 脚本之家/jb51清理美化插件
  6. // @author zhangzhihao
  7. // @license MIT
  8. // @match https://www.jb51.net/article/*
  9. // @icon https://www.jb51.net/favicon.ico
  10. // @grant none
  11. // ==/UserScript==
  12. (function(){
  13.  
  14. const stylesheet = `
  15. #content .jb51code {
  16. width: 100%
  17. }
  18. #main .main-left {
  19. width: 100%
  20. }
  21. #wrapper {
  22. padding: 20px
  23. }
  24. `
  25.  
  26. const beautify = () => {
  27. const $head = document.querySelector('head')
  28. // 加载个样式表好控制
  29. const $style = document.createElement('style')
  30. $style.innerText = stylesheet
  31. $head.appendChild($style)
  32. }
  33.  
  34. const clear = () => {
  35. // 广告位
  36. const $topbar = document.querySelector('#topbar')
  37. const $header = document.querySelector('#header')
  38. const $footer = document.querySelector('#footer')
  39. const $nav = document.querySelector('#nav')
  40. const $submenu = document.querySelector('#submenu')
  41. const $googleAutoPlaced = document.querySelector('.google-auto-placed')
  42. const $googleEsf = document.querySelector('#google_esf')
  43. const $adsbygoogle = document.querySelector('.adsbygoogle')
  44. const $lbdBot = document.querySelector('.lbd_bot')
  45. const $ewm = document.querySelector('#ewm')
  46. const $lbdList = document.querySelectorAll('.lbd')
  47. const $xgcomm = document.querySelector('.xgcomm')
  48. const $mainR = document.querySelector('.main-right')
  49. const $mainL = document.querySelector('.main-left')
  50.  
  51. // 主体
  52. const $container = document.querySelector('#container')
  53. const $main = $container.querySelector('#main')
  54.  
  55. $topbar && $topbar.parentNode?.removeChild($topbar)
  56. $header && $header.parentNode?.removeChild($header)
  57. $footer && $footer.parentNode?.removeChild($footer)
  58. $nav && $nav.parentNode?.removeChild($nav)
  59. $submenu && $submenu.parentNode?.removeChild($submenu)
  60. $googleAutoPlaced && $googleAutoPlaced.parentNode?.removeChild($googleAutoPlaced)
  61. $googleEsf && $googleEsf.parentNode?.removeChild($googleEsf)
  62. $adsbygoogle && $adsbygoogle.parentNode?.removeChild($adsbygoogle)
  63. $lbdBot && $lbdBot.parentNode?.removeChild($lbdBot)
  64. $ewm && $ewm.parentNode?.removeChild($ewm)
  65. $xgcomm && $xgcomm.parentNode?.removeChild($xgcomm)
  66. $mainR && $mainR.parentNode?.removeChild($mainR)
  67. $lbdList && Array.from($lbdList).forEach($1bd => $1bd.parentNode?.removeChild($1bd))
  68.  
  69. Array.from($container.children).forEach($child => {
  70. if ($child !== $main) {
  71. $child && $child.parentNode?.removeChild($child)
  72. }
  73. })
  74. }
  75.  
  76. clear()
  77. beautify()
  78. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址