您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
Automatically complete the login of Shantou University online express
// ==UserScript== // @name 汕头大学上网直通车自动登陆 // @namespace http://tampermonkey.net/ // @version 0.1 // @license Anti 996 License // @description Automatically complete the login of Shantou University online express // @description:zh 自动完成汕头大学上网直通车的登录 // @description:zh-CN 自动完成汕头大学上网直通车的登录,登录网站请打开http://1.1.1.2/* // @author yunjingshan // @match http://1.1.1.2/* // @match http://a.stu.edu.cn/* // @grant none // ==/UserScript== //======================CONFIG====================== // Credentials for auto-login var username = "username"; var password = "password"; // Timeout settings in ms var timeoutBeforeLogin = 1500; var timeoutBeforeCloseWindows = 3000; //================================================== function $(id){ return document.getElementById(id); } function $$(classname){ return document.getElementsByClassName(classname); } function $$$(name){ return document.getElementsByName(name); } var clickevt = document.createEvent("MouseEvents"); clickevt.initEvent("click", true, true); (function() { //填写登录信息 $("password_name").value=username; $("password_pwd").value=password; setTimeout(function(){ //登录 $("password_submitBtn").click(); }, timeoutBeforeLogin); setTimeout(function(){ //关闭窗口 window.close(); }, timeoutBeforeCloseWindows); })();