CSDN Allow Copy

移除CSDN复制限制

As of 2024-05-22. See the latest version.

  1. // ==UserScript==
  2. // @name CSDN Allow Copy
  3. // @namespace http://tampermonkey.net/
  4. // @version 2024-05-20
  5. // @description 移除CSDN复制限制
  6. // @author Mushr00mZhang
  7. // @match https://blog.csdn.net/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. // 创建style标签,添加用户选择样式。
  16. const style = document.createElement('style');
  17. style.innerHTML = `
  18. body #content_views pre {
  19. user-select: auto;
  20. }
  21. body #content_views pre code {
  22. user-select: auto;
  23. }
  24. `;
  25. document.head.appendChild(style);
  26. if (window.$) {
  27. window.$("#content_views").unbind("copy");
  28. }
  29. window.csdn.copyright.textData = '';
  30. })();