PU - E校園一鍵登入

PU-E校園一鍵登入

// ==UserScript==
// @name         PU - E校園一鍵登入
// @namespace    MZ
// @version      0.1
// @description  PU-E校園一鍵登入
// @author       MZ
// @match        https://alcat.pu.edu.tw/*
// @grant        none
// ==/UserScript==

(function() {
    var account = "" ;
    var password = "" ;


    var button = document.createElement("input");
    button.type = "button";
    button.value = "Login";

    var c = document.evaluate('/html/body/nav/div/div[2]/form/div[2]/div[2]/button', document,null,XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
    c.appendChild(button);

    button.onclick = function(){
		document.getElementsByName("uid")[0].value = account;
        document.getElementsByName("upassword")[0].value = password;
	};
})();