Password memorization and autocomplete heuristics in Chrome

11
2013-08
  • Gilles

    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? The username and password fields must have autocomplete="on", and the form must have method="POST", but experimentally, this is not enough.


    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).

    <form name="aspnetForm" method="post" action="default.aspx" onsubmit="javascript:return WebForm_OnSubmit();" id="aspnetForm">
      <table>
        <tr>
          <td>Username:</td>
          <td><input name="foo$name" type="text" id="foo_name" tabindex="1" autocomplete="off" onkeyup="fooFunction()" style="width:175px;" /></td>
        </tr>
        <tr>
          <td>Password:</td>
          <td><input name="foo@pass" type="password" id="foo_pass" tabindex="2" value="" autocomplete="off" style="width:175px;" /></td>
        </tr>
      </table>
    </form>
    

    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 autocomplete="off" to autocomplete="on":

    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 autocomplete="on".

    I tried adding these lines to my userscript, but they don't improve the situation.

    document.querySelector("#foo_user").removeAttribute("onkeyup");
    document.querySelector("#foo_pass").removeAttribute("value");
    

    How do Chrome's heuristics differ from Firefox, and how do I get it to remember my credentials?

  • Answers
  • Tiago CA

    Use the autocomplete=on extension.

    Changes 'autocomplete=off' to 'autocomplete=on' in web pages, so your passwords will be remembered.


  • Related Question

    autocomplete - Autofill password in Google Chrome
  • raoulsson

    I have to do a lot of loggin in on webpages and I like that firefox autofills in my passwords, once it knows them...

    How can I achieve the same for google chrome?

    I have read this post, installed the autofill=true extension but that does not do the job...

    Thanks!


  • Related Answers
  • Stacey Richards

    why don't you use KeePass Password Safe?

    it works with Google Chrome. much safer than storing passwords in a browser.

    Edit:

    KeePass features includes Auto-Type, Global Auto-Type Hot Key and Drag&Drop

    • KeePass can minimize itself and type the information of the currently selected entry into dialogs, webforms, etc. Of course, the typing-sequence is 100% user-customizable, read the documentation file for more.
    • KeePass features a global auto-type hot key. When KeePass is running in the background (with opened database) and you press the hot key, it looks up the correct entry and executes its auto-type sequence.
    • All fields, title, username, password, URL and notes can be drag&dropped into other windows.

    KeePass is free open source software, a portable version is available.

  • 10basetom

    If you're just looking for a secure password manager for Google Chrome, then I recommend the LastPass extension. However, if you're looking for a general purpose automatic form filler, then consider my Autofill extension.