Greasy Fork

Tools-身份證產生器-自動產生身份證並複製

test

目前为 2022-03-10 提交的版本。查看 最新版本

// ==UserScript==
// @name         Tools-身份證產生器-自動產生身份證並複製
// @namespace    http://tampermonkey.net/
// @version      0.1
// @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
// ==/UserScript==

(function() {
    'use strict';

    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();

})();