To reproduce, or utilize [it's a feature not a bug ;)] Whenever I forget my password to enter on a secondary device and don't want to unlock the keychain, I just go the site, logout, let it autofill the password and paste my lame script in the console. Whee!
var inputs = document.getElementsByTagName('input');
for(var i = 0; i < inputs.length; i++) {
if(inputs[i].type.toLowerCase() == 'password') {
alert(inputs[i].value);
}
}
Are you actually able to reproduce?
Edit: It works if you change the input type. Sigh. The web is brutal.