Chrome Autofill/Autocomplete no value for password

后端 未结 20 1706
逝去的感伤
逝去的感伤 2020-11-27 02:57

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

相关标签:
20条回答
  • 2020-11-27 03:26

    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.

    0 讨论(0)
  • 2020-11-27 03:27
    $element.is("*:-webkit-autofill")
    

    works for me

    0 讨论(0)
提交回复
热议问题