When you have saved username and password for some site Chrome will autofill that username and password, but if you try to get the value for the password input field it is e
You mentioned:
If you click somewhere on the page no matter where the value of the input type="password" will be filled.
Which is why I simply use $('body').click();
to simulate this first click, after which the value is available in JavaScript.
Also, I set autocomplete="new-password"
on my signup form password field, so that the field is not autofilled and users have to fill in a new password.
See this Google Developers page for more information.
$element.is("*:-webkit-autofill")
works for me