edwin / 复制 CSDN(私人用)

// ==UserScript==
// @name         复制 CSDN(私人用)
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  复制dom,提交到博客
// @author       edwin
// @license      MIT
// @match        https://blog.csdn.net/*
// @require      https://unpkg.com/jquery@3.3.1/dist/jquery.min.js
// @grant        none
// ==/UserScript==

(function () {
  'use strict';
  let parent = document.querySelector(".article-info-box .operating");
  var html = "<textarea id=\"textcopy\" style=\"margin: 0px; width: 1px; height: 1px;\"></textarea><input type='submit' class='mycopy' onclick='var Url2=document.getElementById(\"content_views\");var clickContent = Url2.innerHTML;var inputElement =  document.getElementById(\"textcopy\");inputElement.value = clickContent;inputElement.select();document.execCommand(\"Copy\");window.open(\"https://zshipu.com/2md/\");' value='拷贝' style='display:inline-block;line-height:1.5;background:#2866bd;color:#fff;font-weight:700;text-align:center;padding:6px;border:2px solid #E5E5E5;'/>"
  let userAdiv = document.createElement("div");
  userAdiv.innerHTML = html;
  parent.insertBefore(userAdiv, parent.childNodes[0]);

})();