CSDN免登录复制

你还在为CSDN需要登录才能复制而感到头疼吗?使用这款脚本,轻松解决你的烦恼。无需登录即可复制代码块。目前仅支持在博客复制。使用说明:直接复制代码,不要点复制按钮。

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         CSDN免登录复制
// @version      1.2
// @description  你还在为CSDN需要登录才能复制而感到头疼吗?使用这款脚本,轻松解决你的烦恼。无需登录即可复制代码块。目前仅支持在博客复制。使用说明:直接复制代码,不要点复制按钮。
// @author       zenglk
// @match        https://blog.csdn.net/*/article/details/*
// @icon         https://zenglingkun.cn/C.ico
// @grant        none
// @namespace https://greasyfork.org/users/952529
// ==/UserScript==

(function() {
    'use strict';

    let codes= document.querySelectorAll("code");
    codes.forEach(c => {
        c.contentEditable = "true";
    });

})();