csdn 极简版

csdn 页面极端简化版, 只显示正文.

Szkript telepítése?
A szerző által javasolt szkript

Ez is érdekelhet: 知乎浏览助手

Szkript telepítése
  1. // ==UserScript==
  2. // @name csdn 极简版
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.0.1
  5. // @description csdn 页面极端简化版, 只显示正文.
  6. // @author kgzhang
  7. // @match https://blog.csdn.net/*/article/details/*
  8. // @grant GM_addStyle
  9. // ==/UserScript==
  10.  
  11. // 有时会渲染失败,影响后面的执行
  12. try{
  13. GM_addStyle('.recommend-right_aside {display:none}');
  14. GM_addStyle('.tool-box {display:none}');
  15. GM_addStyle('.csdn-side-toolbar {display:none}');
  16. GM_addStyle('.blog_container_aside {display:none}');
  17. GM_addStyle('.csdn-toolbar {display:none}');
  18. GM_addStyle('.csdn-toolbar {display:none}');
  19. GM_addStyle('.container#mainBox main {width: unset 1000px}');
  20. GM_addStyle('.blog-content-box{width: 1200px; margin-left: -200px;}')
  21. // 屏蔽评论框
  22. GM_addStyle('.comment-box{display: none;}')
  23. // 屏蔽推荐
  24. GM_addStyle('.recommend-box{display: none;}')
  25. GM_addStyle('.template-box{display: none;}')
  26. } catch (e){
  27.  
  28. }
  29.  
  30.  
  31.  
  32. (function() {
  33. 'use strict';
  34.  
  35. // Your code here...
  36. window.onload = ()=> {
  37. window.localstorage.setItem('anonymousUserLimit','');
  38. const box = document.getElementById('passportbox');
  39. if (box) {
  40. box.style.display = 'none';
  41. }
  42. const blog = document.querySelector('.blog-content-box');
  43. if (blog) {
  44. blog.parentNode.children[4].style.display = 'none';
  45. }
  46. }
  47. window.addEventListener('scroll', ()=>{
  48. // 阅读更多
  49. const got = document.querySelector('a[class="btn-readmore"]')
  50. if (got) {
  51. got.click();
  52. }
  53. })
  54. // 定期检查广告弹框
  55. setInterval(()=>{
  56. const blog = document.querySelector('.blog-content-box');
  57. if (blog && blog.parentElement.children[4].tagName === 'DIV') {
  58. blog.parentElement.children[4].style.display = 'none';
  59. }
  60. }, 200);
  61. })();