// ==UserScript== // @name CSDN Focus // @description 💡: 页面不重绘不闪屏! CSDN,脚本之家无弹窗无广告无推荐阅读, 展开文章和评论, 保留搜索栏, 外链直达! | 受够了脚本注入导致的闪屏重绘页面吗, 试试不一样的感觉吧 😁 // @version 1.2.4.14 // @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 // @compatible chrome 54+ // @compatible firefox 49+ // // @note V1.2 优化:作者标签显示为作者名字, 竖排以减小显示遮挡, 优化动作 // @note V1.1 添加隐藏内容提示标签, 侧边栏和推荐阅读 // @note V1.0 添加脚本之家页面净化 jb51.net 净化 // @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.querySelector(".blog_container_aside").setAttribute("username",uid.title); 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); })();