Myspace Auto-Login

By Steven Barnett Last update Jun 19, 2005 — Installed 13,576 times. Daily Installs: 0, 0, 3, 0, 1, 2, 0, 0, 6, 2, 3, 1, 0, 7, 2, 3, 1, 3, 4, 1, 1, 3, 1, 0, 1, 1, 4, 0, 1, 1, 3, 1
// ==UserScript==
// @name            Myspace Auto-Login
// @namespace       http://slashetc.net/code/
// @description     Auto-login to Myspace, assuming Firefox is set to remember your password. Update: 2005-12-03
// @include         http://myspace.com/*
// @include         http://*.myspace.com/*
// ==/UserScript==
// To report bugs or suggestions, go to http://slashetc.net/home/contact

var pwFocus = false;

function autoLogin(){
    if(pwFocus==false){
        if(document.forms[1].elements.namedItem("password").value.length>1){document.forms[1].submit();}
        else{setTimeout(autoLogin,100);}
    }
}

function focusEvent(){
    pwFocus = true;
}

if(document.forms[1] && document.forms[1].elements.namedItem("password")){
    document.forms[1].elements.namedItem("password").addEventListener("keypress", focusEvent, false);
    window.addEventListener("load", autoLogin, false);
}