Skip to content

Instantly share code, notes, and snippets.

@eliezerlp
Created April 12, 2009 22:40
Show Gist options
  • Save eliezerlp/94163 to your computer and use it in GitHub Desktop.
Save eliezerlp/94163 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name BlueSocket Autologin
// @description Automatically enters your credentials and logs you into a BlueSocket managed wifi network.
// @include https://wireless*.cns.ohiou.edu/login.pl*
// ==/UserScript==
var blueSocketUserName = GM_getValue("blueSocketUserName", false);
var blueSocketPass = GM_getValue("blueSocketPass");
var autoLogin = false //GM_getValue("autoLogin", true);
var loginURL = "https://"+window.location.hostname+"/";
if (document.getElementsByName("error")[0].value) {
alert("There was an error logging in: "+document.getElementsByName("error")[0].value);
}
if (blueSocketUserName == false){
blueSocketUserName = prompt("Please enter your username.");
GM_setValue("blueSocketUserName", blueSocketUserName);
blueSocketPass = prompt("Please enter your password.");
GM_setValue("blueSocketPass", blueSocketPass);
}
GM_setValue("loginURL", loginURL);
// Prevents Firefox from asking to save username or password.
document.getElementById("l_bs_name").setAttribute("autocomplete", "off");
document.getElementById("l_bs_password").setAttribute("autocomplete", "off");
// Fills in the username and password fields.
document.getElementById("l_bs_name").value = blueSocketUserName;
document.getElementById("l_bs_password").value = blueSocketPass;
// Automatically submits the login form.
if (autoLogin == true){
window.setTimeout("document.forms[0].submit();", 1000);
}
// // Open Logout Tab
//GM_openInTab(loginURL+"login.pl?action=logoutPopup");
//doLogout();
//self.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment