Making Auto-Login user script work on Flock

I use the Auto-Login user script at http://labs.beffa.org/greasemonkey/ to ease some of the pain of JEE development.

Recently, I decided to try out Flock for a few days, and the script didn’t work with it.

Thanks to Dive Into Greasemonkey, here is a quick fix.

This part of the script fails when running on Flock browser –

//to prevent submit to stupid site which put fake login / pass value
if (thisElement.value != thisElement.defaultValue) {
passfield = true;
thisElement.addEventListener(’keypress’, al_KeyPress, true);
}

For some reason, thisElement.value is always empty on Flock. On Firefox, it shows the actual value of the field.
Anyway, since I only use this script to login into a particular web page, I removed that if condition, and it works fine.