csdn 文章复制

将文章内容弹窗显示,可以复制到md文档中

  1. // ==UserScript==
  2. // @name csdn 文章复制
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description 将文章内容弹窗显示,可以复制到md文档中
  6. // @author You
  7. // @match https://blog.csdn.net/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=csdn.net
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. let div=document.createElement("div");
  16. div.innerHTML='<button id="span-1" style="z-index: 9999;position: fixed;top: 80%;right: 10%;color: #fff;width: 100px;height: 50px;background-color: #ff03038f;">打开新页面</button>';
  17. div.onclick=function(event){
  18. var html=document.getElementsByClassName("blog-content-box");
  19. console.log(html[0].innerText)
  20. console.log(html[0].innerHTML)
  21. let myWindow=window.open('','','width=1920,height=1080');
  22. myWindow.document.write(html[0].innerHTML)
  23. myWindow.focus();
  24. };
  25. document.body.append(div);
  26.  
  27. })();