Issue
Is it possible to prevent autofill even when the creds are stored in the browsers logins and passwords?
Or is there a way to prevent creds being saved to the browser?
Or is it better to allow both of these browser features? I'm just think about security if people share machines.
I have tried autocomplete="off"
on the inputs and form but it still autofills the fields if there is creds are already stored in the browser and if theyre not then it prompts to save them.
<form autocomplete="off">
<h1>Login</h1>
<input type="text" autocomplete="off" placeholder="username" />
<input type="password" autocomplete="off" placeholder="password" />
</form>
Any help would be appreciated!
Solution
It's because password autocompletion is not common autocompletion, most modern browsers are using some different mechanics to fill these fields. MDN says it can be disabled by adding autocomplete="new-password"
to the fields, though it is new feature and may not work in some browsers. It surely works in Opera 68.
So your code should be something like this:
<form autocomplete="off">
<h1>Login</h1>
<input type="text" autocomplete="new-password" placeholder="username" />
<input type="password" autocomplete="new-password" placeholder="password" />
</form>
This question is actually answered here: Disabling Chrome Autofill
Answered By - tftoclik
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.