copyright

修改为仅仅去除所有网站复制带来的小尾巴数据、破解复制权限

  1. // ==UserScript==
  2. // @name copyright
  3. // @namespace http://tampermonkey.net/
  4. // @version 2.3
  5. // @description 修改为仅仅去除所有网站复制带来的小尾巴数据、破解复制权限
  6. // @author You
  7. // @match *://*/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function () {
  12. 'use strict';
  13.  
  14. [].slice.call(document.getElementsByTagName('*')).forEach((ele) => {
  15. ele.addEventListener("copy", function (t) {
  16. t.clipboardData.setData("text", getMySelection())
  17. t.preventDefault()
  18. })
  19. })
  20.  
  21. function getMySelection() {
  22. let e = window.getSelection().getRangeAt(0).cloneContents().textContent
  23. return e
  24. }
  25. // M.copyright.config = {}
  26. // csdn.copyright.init($("article")[0], '', '');
  27. // let host = window.location.host
  28. // if (host === 'blog.csdn.net') {
  29. // document.getElementById('btn-readmore').click()
  30. // }
  31. })();