CSDN复制

CSDN免登陆复制并去除版权声明

当前为 2023-05-22 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name CSDN复制
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1.3
  5. // @description CSDN免登陆复制并去除版权声明
  6. // @author You
  7. // @match https://blog.csdn.net/*/article/details/*
  8. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. // Your code here...
  16. const content_views = document.querySelector("#content_views")
  17. let dialog = null
  18. content_views.oncopy = function(e){
  19. const str = window.getSelection().toString()
  20. e.clipboardData.setData('text',str || "")
  21. if(!dialog){
  22. getEle()
  23. }
  24. }
  25. const getEle = function(){
  26. dialog = document.querySelector(".passport-login-container")
  27. if(dialog){
  28. dialog.setAttribute("style","display:none;")
  29. } else {
  30. setTimeout(()=>{
  31. getEle()
  32. },300)
  33. }
  34. }
  35. })();