Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm a developer and it's VERY annoying having Chrome suggest all my personal address information in forms one web sites I'm developing on running on my local machine. Is disabling Autofill on localhost, or a domain, or an IP address possible? I'm not seeing anything in the advanced settings.

share|improve this question
    
Although "as a developer", don't you want the same experience on your local test server as you would on the live site? –  w3d Dec 25 '12 at 0:16
3  
If I want to test browser specific stuff like Autofill, I would do it against a test server. –  Gromer Dec 25 '12 at 0:18
add comment

5 Answers

up vote 3 down vote accepted
+50

I recently answered another question with the same requirement of customizing features of Chrome (and also inspired from @Paul).

NOTE: This solution allows you to block a specific IP address or list of IPs, without having to load any additional library and no additional scripts in your project. Fact often you may have blocked all Javascript features, but the control "noautofill" follow operating, avoiding collisions with other libraries, allowing also you have a real recognition of the consumption charge and rendering time, and this can translate into savings of time debugging day to day, on different web projects.

Create a Chrome extension that uses the "match filter host" of the Chrome API, and filter your custom IP host or namehost. Then set the attribute autocomplete to off for all "input" and "form" tags.

We proceed with these steps:

  • Create a new folder named ex. noautofill

  • Create into our new folder, a new file named manifest.json and add this code inside:


{
  "name": "No Autofill",
  "version": "1.0",
  "manifest_version": 2,
  "description": "No Autofill.",  
  "content_scripts": [ {
      "all_frames": true,
      "exclude_globs": [  ],
      "include_globs": [ "*" ],  
      "js": [ "script.js" ],      
      "matches": [   
                   "http://192.168.1.100/",
                   "http://127.0.0.1/",
                   "http://10.0.1.100/",
                   "http://localhost/",
                   "http://wp.local/",
                   "http://192.168.1.100/*",
                   "http://127.0.0.1/*",
                   "http://10.0.1.100/*",
                   "http://localhost/*",
                   "http://wp.local/*"                   
                    ],
      "run_at": "document_start"
   } ],
  "permissions": [ "tabs", "http://*/", "https://*/", "https://*/*", "http://*/*", "contextMenus" ]

}
  • In our new folder, create a new file named script.js and add this code inside:


(function(){    
    chrome.extension.sendRequest({
        autofill:'off'
    },function(){       
        var inputnodes = document.getElementsByTagName('input');    
        for(var i=0;i<inputnodes.length;i++){       
            inputnodes[i].setAttribute('autocomplete','off');
        }       
        var formnodes = document.getElementsByTagName("form");    
        for(var i=0;i<formnodes.length;i++){                    
            formnodes[i].setAttribute('autocomplete','off');
        }       
  });
})();
  • We go to Chrome's menu » Settings » Extensions

  • Now we click the button "Load unpacked extensions"

  • Finally we mark our folder and click on the open button.

This is the result:

noautofill

This system is very simple, and you can customize the file script.js with your own control code. In the future you may add other scripts, CSS, configuration pages, etc. Remember that every time you will make changes in the file script.js you should reload the plugin with CtrlR.

Also you can get a more detiled guide about how to create Chrome extensions.

share|improve this answer
    
Please don't overdo it with the formatting. Remember, sometimes less is more. I edited your post to remove the bold, italics and quotes that are not needed. –  slhck Jan 5 '13 at 21:20
    
Thanks! Sorry for inconvenience. –  RTOSkit Jan 5 '13 at 21:25
1  
No problem, just a tip for the future :) –  slhck Jan 5 '13 at 21:32
1  
I like this solution the most, thank you! Not a big fan of having to manage multiple profiles, which would work, just not the solution I'm looking for. This allows things to be more streamlined for me. Thanks everyone! –  Gromer Jan 7 '13 at 18:24
1  
Nice solution! I think you may have missed a wildcard on the second 10.0.1.100 though? –  Paul Jan 7 '13 at 20:45
show 1 more comment

The other answers regarding using a second profile or installing a second version of Chrome should work fine. I'm taking a different angle only to provide another option, not because I think this is a better way of doing it.


As you are developing a website locally, simply include the jQuery library and a jQuery script with the following code:

$(document).ready(function() {
    $(":input").attr("autocomplete","off");
});

This turns auto-fill off for all inputs on the webpage. Used in conjunction with a server-side include file (in the head) means it would be very easy to add this during testing and remove it for production for an entire website.

share|improve this answer
1  
1+ You have inspired me, for my second solution. –  RTOSkit Jan 5 '13 at 19:11
add comment

One solution (for test purposes) would be to Add new use profile without Autofill.

Use this profile while testing to avoid Autofill.

share|improve this answer
    
+1 I love Chrome Multiuser –  RTOSkit Jan 4 '13 at 20:21
add comment

Unfortunately, Google Chrome does not have a per-site filtering option for auto-fill.

One alternative is to use the Lastpass Chrome extension, where you can decide which field to be remembered on a per-site basis.

The other alternative is by creating a new user profile Chrome settings -> Users -> Add new user or installing different versions of chrome (Chrome Stable / Beta / Dev, Chrome Canary, or Chromium).

share|improve this answer
add comment

Could achieve their purpose with Autofill extension.

I think it has all the features you are looking for.

autofill

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.