Commit 1c9debe8 authored by Zeyu DONG's avatar Zeyu DONG
Browse files

fix limitless loop when error password

parent e1ac4204
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
if(document.URL.indexOf("https://cas.sustc.edu.cn/cas/login") >= 0 )   
{
	chrome.runtime.sendMessage({storage: "all"}, function(response) {
		var user = response.username;
		var pass = response.password;
		var auto = response.auto;
		if(auto=='true'){
		if(document.getElementById('msg')==null){
			if(response.auto=='true'){
				document.getElementById('username').value = response.username;
				document.getElementById('password').value = response.password;
				document.getElementsByName('submit')[0].click();
			}
		}
		else{
			if(document.getElementById('msg').getAttribute('class')=='errors'&&response.auto=='true'){
				document.getElementById('msg').innerText = '用户名密码错误!请在插件中更新信息并从地址栏刷新页面';
				
			}
		}
	});
} else if(document.URL.indexOf("http://enet.10000.gd.cn:10001/sz/sz112/transfer.jsp") >= 0 ) {
	document.getElementsByTagName('input')[0].click();
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@
		</tr>
		<tr>
			<td><button type="button" id="change">Save</button></td>
			<td id="ok" style="display:none;">OK<td>
			<td id="ok" style="display:none;">Saved<td>
		</tr>
	</table> 
		<input type="checkbox" id="auto">Enable auto login</input>