CSDN Enable Right Click & Copy

绕过csdn烦人的复制限制

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください。
  1. // ==UserScript==
  2. // @name CSDN Enable Right Click & Copy
  3. // @namespace Absolute Right Click
  4. // @description 绕过csdn烦人的复制限制
  5. // @author DM
  6. // @version 1.0.0
  7. // @match *://*.csdn.net/*
  8. // @grant GM_registerMenuCommand
  9. // @license BSD
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. var follow_text = document.getElementsByClassName('follow-text')[0];
  14. if (follow_text && follow_text.parentElement) {
  15. document.querySelector("#article_content").removeAttribute("style");
  16. follow_text.parentElement.parentElement.removeChild(follow_text.parentElement);
  17. var hide_article_box = document.getElementsByClassName(' hide-article-box')[0];
  18. hide_article_box.parentElement.removeChild(hide_article_box);
  19. }
  20. window.oncontextmenu = document.oncontextmenu = document.oncopy = null;
  21. [...document.querySelectorAll('body')].forEach(dom => {dom.outerHTML = dom.outerHTML});
  22. [...document.querySelectorAll('body, body *')].forEach(dom => {
  23. ['onselect', 'onselectstart', 'onselectend', 'ondragstart', 'ondragend', 'oncontextmenu', 'oncopy'].forEach(ev => dom.removeAttribute(ev));
  24. dom.style['user-select'] = 'auto';
  25. });
  26. })();
  27.