// ==UserScript== // @name Tools-身份證產生器-自動產生身份證並複製 // @namespace http://tampermonkey.net/ // @version 0.2 // @description test // @author Hander // @match https://people.debian.org/~paulliu/ROCid.html // @icon https://www.google.com/s2/favicons?domain=debian.org // @grant none // @license MIT // @downloadURL none // ==/UserScript== (function() { 'use strict'; console.log(2); output2(city,sex,mid,idoutput1,idoutput2); output3(idoutput1,idoutput2,city,sex,mid); // idoutput1.a.select(); // document.execCommand("copy"); var textarea = document.createElement('textarea'); textarea.textContent = idoutput1.a.value; document.body.appendChild(textarea); var selection = document.getSelection(); var range = document.createRange(); range.selectNode(textarea); selection.removeAllRanges(); selection.addRange(range); console.log('copy success', document.execCommand('copy')); selection.removeAllRanges(); document.body.removeChild(textarea); idoutput1.a.select(); })();