Greasy Fork is available in English.

CSDN Focus

💡: 页面不重绘不闪屏! CSDN无弹窗无广告无推荐阅读, 展开文章和评论, 保留搜索栏, 外链直达! | 受够了脚本注入导致的闪屏重绘页面吗, 试试不一样的感觉吧 😁

Stan na 04-02-2021. Zobacz najnowsza wersja.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

  1. // ==UserScript==
  2. // @name CSDN Focus
  3. // @description 💡: 页面不重绘不闪屏! CSDN无弹窗无广告无推荐阅读, 展开文章和评论, 保留搜索栏, 外链直达! | 受够了脚本注入导致的闪屏重绘页面吗, 试试不一样的感觉吧 😁
  4. // @version 0.8
  5. // @author Finn
  6. // @namespace https://github.com/Germxu
  7. // @homepage https://github.com/Germxu/Scripts-for-TamperMonkey
  8. // @supportURL https://github.com/Germxu/Scripts-for-TamperMonkey/issues/new
  9. // @run-at document-start
  10. // @match blog.csdn.net/*/article/details/*
  11. // @match *.blog.csdn.net/article/details/*
  12. // @grant none
  13. // @license MIT
  14. // @note V0.8 使用原生API, 放弃GM_***
  15. // @note V0.7 操作优化
  16. // @note V0.6 添加外联直达, 去他妈的跳转提醒
  17. // @note V0.5 保留搜索栏, 并优化搜索栏动作
  18. // @note v0.4 隐藏大屏幕下的右侧边栏
  19. // @note v0.3 展开全部评论和翻页键, 展开需要关注阅读文章
  20. // @note v0.2 JS重置样式改为纯CSS注入,页面不再重绘, 所见所得
  21. // ==/UserScript==
  22.  
  23. (function () {
  24. 'use strict';
  25. const hideChaos = `<style>
  26. #csdn-toolbar .toolbar-advert,#csdn-toolbar .toolbar-container-left,#csdn-toolbar .toolbar-container-right,
  27. .toolbar-search-drop-menu.toolbar-search-half, ::-webkit-input-placeholder, #placeholder
  28. #blogColumnPayAdvert, .csdn-side-toolbar, aside, #dmp_ad_58,
  29. .recommend-box, .login-mark, .blog-footer-bottom, .template-box,.leftPop,
  30. #toolBarBox, .comment-edit-box.d-flex, #passportbox, .opt-box.text-center,
  31. .hide-article-box.hide-article-pos.text-center, #rightAside, .hljs-button.signin
  32. {display:none!important; color: transparent; visible:hidden}
  33. .toolbar-search.onlySearch{transition:all 0.3s ease;}
  34. body #csdn-toolbar{box-shadow: 0 2px 10px 0 rgba(0,0,0,.15);position:fixed !important;top: 0px;left: 0px;width: 100%;z-index: 1993;}
  35. .toolbar-search.onlySearch:focus-within {max-width:1000px!important; width:1000px!important}
  36. .d-flex{display:block!important}
  37. .main_father{height: auto !important;}
  38. main{width:100%!important; box-shadow: 0 0 30px #959fa378; margin-bottom:0!important;}
  39. #mainBox{margin:50px auto; width:1000px!important}
  40. .comment-list-box{max-height:none!important}
  41. #commentPage, .toolbar-container-middle{display:block!important}
  42. #article_content{height:auto !important}
  43. .comment-list-container{padding: 4px 0!important}
  44. .article-header-box{padding-top: 18px !important}
  45. main .comment-box{padding: 0;box-shadow: 0 0 10px rgba(0,0,0,0.05);margin:8px 0;}
  46. </style>`;
  47.  
  48. document.documentElement.insertAdjacentHTML('afterbegin', hideChaos);
  49.  
  50. //外链直达, 以新页面打开
  51. window.addEventListener("DOMContentLoaded", function () {
  52. document.body.addEventListener('click', function (e) {
  53. let ev = e.target;
  54. if (ev.nodeName.toLocaleLowerCase() === 'a') {
  55. if (ev.host.indexOf("csdn") === -1) {
  56. e.stopImmediatePropagation();
  57. window.open(ev.href);
  58. e.preventDefault();
  59. }
  60. }
  61. }, true);
  62. })
  63.  
  64. })();