// ==UserScript== // @name CSDN Focus // @description 💡: 页面不重绘不闪屏! CSDN, 脚本之家无弹窗无广告无推荐阅读, 展开文章和评论, 保留搜索栏, 外链直达! | 受够了脚本注入导致的闪屏重绘页面吗, 试试不一样的感觉吧 😁 // @version 1.0.3 // @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.0 添加脚本之家页面净化 jb51.net 净化 // @note V0.9 添加返回顶部按钮, 重新释放侧边栏和推荐阅读, 尽可能不影响阅读 // @note V0.8 使用原生API, 放弃GM_*** // @note V0.7 操作优化 // @note V0.6 添加外联直达, 去他妈的跳转提醒 // @note V0.5 保留搜索栏, 并优化搜索栏动作 // @note v0.4 隐藏大屏幕下的右侧边栏 // @note v0.3 展开全部评论和翻页键, 展开需要关注阅读文章 // @note v0.2 JS重置样式改为纯CSS注入,页面不再重绘, 所见所得 // @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); })();