CSDN复制优化(自用)

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

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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';
        }
    }
})();