-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpopup.js
More file actions
25 lines (20 loc) · 709 Bytes
/
popup.js
File metadata and controls
25 lines (20 loc) · 709 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function save() {
usernameTextbox = document.getElementById('username');
passwordTextbox = document.getElementById('password');
extensionId = chrome.extension.getURL('popup.js').match(/:\/\/([a-z]+)\//i)[1];
chrome.extension.sendMessage(extensionId, {
act: "loginInit",
username: usernameTextbox.value,
password: passwordTextbox.value,
origin: "popup" // Just to mirror autoLogin
});
if(passwordTextbox.value != "") {
passwordTextbox.value = "*****";
}
window.close();
return false;
}
window.onload = function() {
document.forms[0].onsubmit = save;
document.getElementById('save-button').onclick = save;
};