What are Chrome's heuristics to decide to save login form data and autocomplete them on the next visit?
If Chrome isn't saving the credentials on a particular form, what could the reasons be? I know that:
Experimentally, this is not enough: I have a login page (private, sorry, but the gist of the code is below) that meets both criteria and where the credentials aren't autocompleted.
Here's my specific problem. I've solved it another way (by installing Autofill and making it enter my credentials on the form), but I'd still like to know why Chrome isn't offering to save the credentials.
A website (not written by me, and not publicly accessible) requires a username and password. It uses a fairly standard-looking (to my uninformed eyes) form, which looks like this (I've omitted a lot of nested
<div> and whatnot, and attributes and functions shown here as
fooXXX were renamed by me).
I want my browser to remember my credentials for this site. The feature is enabled in the browser, but there's something peculiar about this site that causes both Firefox and Chrome not to offer to remember the name and password.
I wrote a userscript (Greasemonkey script in Firefox, unpacked extension in Chrome) to change
document.querySelector("#foo_user").setAttribute("autocomplete", "on"); document.querySelector("#foo_pass").setAttribute("autocomplete", "on");
In Firefox, this has the desired effect: Firefox offers to remember the password, and the next time I visit the login page my credentials are autofilled.
No such luck in Chrome (27.0.1453.93, Linux). I don't get prompted to remember the password and don't get a history for the username field. I have confirmed that the script is executed by inspecting the
input elements, they do show
I tried adding these lines to my userscript, but they don't improve the situation.
How do Chrome's heuristics differ from Firefox, and how do I get it to remember my credentials?