https://github.com/TomasHubelbauer/web-remember-credentials
Seeing how to make the browser offer to remember your credentials in a web app.
- How can I get browser to prompt to save password?
- How to enable remember password in case of AJAX login?
Run index.html
.
This site is also served using GitHub Pages on https://tomashubelbauer.github.io/web-remember-credentials.
Submit any of the forms. Once you've done so and saved the credentials, they will be pre-filled and you won't be able to emulate this unless you remove them throught the Settings. There is an easier way to keep testing though: change the password to a new value and observe the behavior of the update credentials prompt, which is triggered under similar conditions.
I only tested this in Firefox, because it is for a personal project and I don't care about other browsers in this case.
I also tried with mobile Safari, but in it, it does not work. It should be possible to fix that using https://stackoverflow.com/a/60607611/2715716.
I have tried that with a handled form, but it seems to require form submission,
and with that, it no longer requires the autocomplete
attributes. It requires
that both user name and password fields exist, password only is not enough.
The inputs do not seem to need to have name
s or anything else, the credentials
save prompt is displayed.
This also works, the input
need not have a name
.
Again, the input
need not have a name
and with preventDefault
, the prompt
still shows. In fact, it appears to appear before the form submission navigation
even occurs (or, would occur).
It is well known that any button in a form
will submit it, even it it lacks
type=submit
. This is frequently used even in non-SPAs to be able to use richer
display in the button
, such that is not provided by input[type=submit]
.
Turns out this also triggers the prompt!