Fixed Safari Autofill on localhost

After updating to Yosemite, which updated Safari to version 8, autofill stopped working for localhost. After some searching, it appears that this is due new security rules for Safari and OS X. Of course, that didn’t stop me from trying to get this working again as it made developing on localhost very cumbersome. The fix is pretty simple.

All you need to do is edit your /etc/hosts file and add a fully-qualified domain name alias for 127.0.0.1. Here’s how mine looks:

127.0.0.1	localhost
255.255.255.255	broadcasthost
::1             localhost
127.0.0.1       cleanspeak.inversoft.com

I added the cleanspeak.inversoft.com entry. Now I can access localhost using this alias and Safari nicely does autofill on form fields.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s