edwin / 复制 dev.to(私人用)

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

(function () {
  'use strict';
  let parent = document.querySelector(".title .tags");
  var html = "<textarea id=\"textcopy\" style=\"margin: 0px; width: 0px; height: 0px;\"></textarea><input type='submit' class='mycopy' onclick='var Url2=document.getElementById(\"article-body\");var clickContent = Url2.innerHTML;console.log(clickContent);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]);
})();