CSDN免登录复制

copy code without login from csdn, auto readmore

// ==UserScript==
// @name         CSDN免登录复制
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  copy code without login from csdn, auto readmore
// @author       PathOfLife
// @match        https://blog.csdn.net/*/article/details/*
// @icon         https://g.csdnimg.cn/static/logo/favicon32.ico
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';
    document.querySelectorAll("pre").forEach(preEle => {
        const hideCodeBox = preEle.querySelector(".hide-preCode-box");
        const codeBox = preEle.querySelector("code")
        hideCodeBox.style.display = "none";
        preEle.style.height = "auto";
        preEle.style.userSelect = "auto";
        codeBox.style.userSelect = "auto";
    });
})();