CSDN复制优化(自用)

取消CSDN登录需要登录才能复制的功能

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         CSDN复制优化(自用)
// @version      0.1
// @description  取消CSDN登录需要登录才能复制的功能
// @author       violent
// @match        *.csdn.*,*
// @icon         https://www.google.com/s2/favicons?domain=juejin.cn
// @grant        none
// @namespace https://greasyfork.org/users/882015
// ==/UserScript==

(function() {
    'use strict';
    let docParent=document.getElementsByTagName("pre");
    let docCode=document.getElementsByTagName("code");
    let loginWord=document.getElementsByClassName('passport-login-container');

    clearSelect(docParent)
    clearSelect(docCode);
    try{
        loginWord[0].style['display']='none'
    } catch(e){}
    function clearSelect(_domList){
        for(var i=0;i<_domList.length;i++){
            _domList[i].style['-webkit-touch-callout']='auto';
            _domList[i].style['-webkit-user-select']='auto';
            _domList[i].style['-khtml-user-select']='auto';
            _domList[i].style['-moz-user-select']='auto';
            _domList[i].style['-ms-user-select']='auto';
            _domList[i].style['user-select']='auto';
        }
    }
})();