Force Safari to save sites' autofill-blocked form data

Oct 15, '04 11:25:00AM

Contributed by: doggkruse

Some bank websites use the property autofill=off in their web forms to tell browsers not to remember your password. I find this really annoying and wanted it to stop. It turns out you cannot override this setting with a custom CSS file, so another solution is required. We are going to intercept the page before Safari gets it, and remove all of the autofill=off tags.

Read the rest of the hint for my solution...

Here is my quick fix:

  1. Turn on personal web sharing (System Prefs -> Sharing).

  2. Create the following plain text file and save it in your user's Sites folder as remember.php:.
    <?php
    $server = str_replace("/*", ".com", $url);
    $wells = file_get_contents($server);
    $wells2 = str_replace("autocomplete=\"off\"", " ", $wells);
    print "$wells2";
    ?>
    
  3. Create the following plain text file and save it in the top-level /Library -> WebServer -> Documents folder as index.html:
    <SCRIPT  LANGUAGE="JavaScript">
    var currentLoc=window.location;
    window.location="http://localhost/~yourUserName/remember.php?url=" + currentLoc + "*";
    </script>
    
  4. Edit your /etc/hosts file and add a line for each site you want to be stripped. For example:
    127.0.0.1 wellsfargo 
    
    Notice that the .com is missing.

  5. In the Terminal, type sudo killall -HUP lookupd to restart the lookup services.

  6. Restart Safari.
Now when you want to access wellsfargo.com and have it remember your password, type wellsfargo in the location bar and hit enter. All of the autofill=off tags will be stripped out, and Safari will remember your username and password.

Comments (41)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20041012233334948