测试脚本

try to take over the world!

// ==UserScript==
// @name         测试脚本
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       小猪
// @match        http://www.waheng.fun
// @match        http://10.10.26.199/zc/prog1/answer.aspx
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    function copyInfo(info)
    {
        var oInput = document.createElement('input');
        oInput.value = info;
        document.body.appendChild(oInput);
        oInput.select(); // 选择对象
        document.execCommand("Copy"); // 执行浏览器复制命令
        oInput.className = 'oInput';
        oInput.style.display='none';

    }

    function getQue()
    {
        var i = 1;
        var que = document.querySelector("#Label10");
        var title = que.innerHTML;
        //console.log(que);
        //alert(title);
        console.log(title);
        console.log(i);
        copyInfo(title);
    }

    getQue();
})();