This works flawlessly under Chrome, but in Firefox the fields don't populate until the SECOND time I hit submit on the page (after it comes back from the first time telling me invalid user/pass). What am I missing?
This is my code for the Greasemonkey script:
document.getElementById('loginBtn').addEventListener('click',
function (event) {
document.getElementById('serverLogin').selectedIndex = "2";
document.getElementById('usernameLogin').value = "username";
document.getElementById('passwordLogin').value = "password";
document.getElementById('loginForm').action = 'urltosubmit';
location.href="javascript:(function(){ document.forms['loginForm'].submit(); })()";
},true);