您好,欢迎访问一九零五行业门户网

geasemonkey自动登陆脚本如何设置

// ==userscript== // @name 自动填写用户名和密码 // @namespace autologin // @version 1 // @include https://xxx.xxx.xxx.xxx/login/requirelogin // @include https://xxx.xxx.xxx.xxx/login/requirelogin // @include https://xxx.xxx.xxx.xxx/accounts/login* // @grant none // ==/userscript== var globalconfig = { 'sitelist': [ { targeturlregex : new regexp("^https:\/\/xxx.xxx.xxx.xxx\/login\/requirelogin$"), attributename: 'id', usernamekey: 'username', usernameval: '****', passwordkey: 'password', passwordval: '****', }, { targeturlregex : new regexp("^https:\/\/xxx.xxx.xxx.xxx\/accounts\/login.*\/$"), attributename: 'id', usernamekey: 'username', usernameval: '****', passwordkey: 'password', passwordval: '****', }, { targeturlregex : new regexp("^https:\/\/xxx.xxx.xxx.xxx\/(index\.php)?$"), attributename: 'id', usernamekey: 'username', usernameval: '****', passwordkey: 'userpasswd', passwordval: '****', }, { targeturlregex : new regexp("^https:\/\/xxx.xxx.xxx.xxx\/signin.screen$"), attributename: 'id', usernamekey: 'username', usernameval: '****', passwordkey: 'password', passwordval: '****', }, ] }; window.autologin = function() { var sitelist = globalconfig.sitelist; if (!sitelist.length) { return; } //; var cur_url = window.location; //; for (var indx in sitelist) { var test = sitelist[indx].targeturlregex.test(cur_url); if (!test) { continue; } var inputs = document.body.getelementsbytagname('input'); // for (var i in inputs) { var input = inputs[i]; if (input[sitelist[indx].attributename] == sitelist[indx].usernamekey) { input.value = sitelist[indx].usernameval; } else if (input[sitelist[indx].attributename] == sitelist[indx].passwordkey) { input.value = sitelist[indx].passwordval; } } document.getelementsbytagname("form")[0].submit(); } } window.settimeout("autologin()",1000);
以上就是geasemonkey自动登陆脚本如何设置的详细内容。
其它类似信息

推荐信息