CSDN Enable Right Click & Copy

绕过csdn烦人的复制限制

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

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

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

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

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

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

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name          CSDN Enable Right Click & Copy
// @namespace     Absolute Right Click
// @description   绕过csdn烦人的复制限制
// @author        DM
// @version       1.0.0
// @match         *://*.csdn.net/*
// @grant         GM_registerMenuCommand
// @license       BSD
// ==/UserScript==

(function() {
   var follow_text = document.getElementsByClassName('follow-text')[0];
   if (follow_text && follow_text.parentElement) {
       document.querySelector("#article_content").removeAttribute("style");
       follow_text.parentElement.parentElement.removeChild(follow_text.parentElement);
       var hide_article_box = document.getElementsByClassName(' hide-article-box')[0];
       hide_article_box.parentElement.removeChild(hide_article_box);
   }
   window.oncontextmenu = document.oncontextmenu = document.oncopy = null;
   [...document.querySelectorAll('body')].forEach(dom => {dom.outerHTML = dom.outerHTML});
   [...document.querySelectorAll('body, body *')].forEach(dom => {
       ['onselect', 'onselectstart', 'onselectend', 'ondragstart', 'ondragend', 'oncontextmenu', 'oncopy'].forEach(ev => dom.removeAttribute(ev));
       dom.style['user-select'] = 'auto';
   });
})();