您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
csde 快捷复制、不带版权文字、查看全文等功能
// ==UserScript== // @name CSDN快捷工具 // @namespace http://tampermonkey.net/ // @version 0.1.6 // @description csde 快捷复制、不带版权文字、查看全文等功能 // @author 昊色居士 // @match *.csdn.net/* // @match https://blog.csdn.net/* // @icon https://www.google.com/s2/favicons?domain=csdn.net // @grant none // @license MIT // ==/UserScript== (function () { /** * 复制事件 */ function copy_event(button_doc, code_dom) { const codeText = code_dom.innerText; navigator.clipboard.writeText(codeText) .then(()=> { button_doc.setAttribute("data-title", "复制成功!") setTimeout(()=> button_doc.setAttribute("data-title", "点我复制"), 1000) }) .catch(err => { alert("复制失败!"); console.error("复制失败:", err); }); } // 允许不登录(不可用)复制 document.querySelector("#content_views").style.setProperty('user-select', 'text', 'important') for (const e of document.querySelectorAll('#content_views pre')) { e.style.setProperty('user-select', 'text', 'important') } for (const e of document.querySelectorAll('#content_views pre code')) { e.style.setProperty('user-select', 'text', 'important') } $("#content_views").unbind() // 复制不带版权 var copy_element = document.querySelector('main .blog-content-box') csdn.copyright.init(copy_element, '') // 登录(不可用)后复制按钮 data-title 改成随便复制并删除点击事件 document.querySelectorAll('#content_views pre').forEach( doc => { let button_doc = doc.querySelector(".hljs-button") let code_doc = doc.querySelector("code") button_doc.setAttribute("data-title", "点我复制") code_doc.setAttribute("onclick", undefined) button_doc.setAttribute("onclick", undefined) button_doc.onclick = () => copy_event(button_doc, code_doc) } ) // 不关注博主即可看全文 $(".hide-article-box").hide() $("div.article_content").removeAttr("style") })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址