// ==UserScript== // @name CSDN Focus // @description 💡: 页面不重绘不闪屏! CSDN, 脚本之家无弹窗无广告无推荐阅读, 展开文章和评论, 保留搜索栏, 外链直达! | 受够了脚本注入导致的闪屏重绘页面吗, 试试不一样的感觉吧 😁 // @version 1.1.4.12 // @author Finn // @namespace https://github.com/Germxu // @homepage https://github.com/Germxu/Scripts-for-TamperMonkey // @supportURL https://github.com/Germxu/Scripts-for-TamperMonkey/issues/new // @run-at document-start // @match blog.csdn.net/*/article/details/* // @match *.blog.csdn.net/article/details/* // @match www.jb51.net/article/* // @grant none // @license MIT // @note V1.1 添加隐藏内容提示标签, 侧边栏和推荐阅读 // @note V1.0 添加脚本之家页面净化 jb51.net 净化 // @note V0.9 添加返回顶部按钮, 重新释放侧边栏和推荐阅读, 尽可能不影响阅读 // @note V0.8 使用原生API, 放弃GM_*** // @downloadURL none // ==/UserScript== (function () { 'use strict'; const csdn = `
`; const jb51 = ``; let hideChaos; if (location.host === "www.jb51.net") { hideChaos = jb51; } else { hideChaos = csdn; //外链直达, 以新页面打开 window.addEventListener("DOMContentLoaded", function () { document.body.addEventListener('click', function (e) { let ev = e.target; if (ev.nodeName.toLocaleLowerCase() === 'a') { if (ev.host.indexOf("csdn") === -1) { e.stopImmediatePropagation(); window.open(ev.href); e.preventDefault(); } } }, true); $("#FinnTop").click(function () { $("body,html").animate({ scrollTop: 0 }, 300); }); }) } document.documentElement.insertAdjacentHTML('afterbegin', hideChaos); })();