Is autocomplete=“off” compatible with all modern b

2019-01-01 13:07发布

问题:

I\'ve just been given a requirement to prevent browsers from saving data entered into specific form fields. It\'s been years since I\'ve done web dev, and this is a relatively new capability. I was able to find the form field property autocomplete=\"off\", but I can\'t seem to find any documentation indicating which browsers support it. Can anyone point me in the right direction of a chart of form attributes and browser compatibility?

回答1:

Be aware that all major browsers are moving towards ignoring the attribute for password fields.

I can only offer anecdotal evidence, but I\'ve yet to come across a browser that fails to respect autocomplete=\"off\", this experience covers:

  • Firefox 1.5+ (Windows and Ubuntu)
  • Opera 6+ (Windows and Ubuntu)
  • Chrome v2+ (Windows and Ubuntu)
  • Epiphany 0.8 (ish) (Ubuntu)
  • Midori (I can\'t remember which version)
  • Safari v1+ (Windows)
  • IE 4 - 8, Windows.

I\'m aware that Greasemonkey scripts, and presumably other user-scripts, can disable the autocomplete setting.

There\'s a couple of articles I found that might be useful to you:

  1. How to turn off form auto-completion
  2. Using auto-complete in html forms


回答2:

Password managers now ignore the autocomplete attribute for password fields in the major browsers as of:

  • IE11
  • Firefox 30
  • Chrome 34
  • Safari seems to have an opt-in option to ignore them

It should still work fine for disabling autocomplete on form fields, but no longer affects the password manager.



回答3:

As of Chrome v34, autocomplete=\"off\" is now ignored by default.

This somewhat debatable feature can be disabled in the flags configuration by visiting chrome://flags

http://news.softpedia.com/news/Chrome-34-Seeks-to-Save-All-Your-Passwords-436693.shtml



回答4:

If you\'re able to use JavaScript and jQuery, you can place this on load of the html:

$(\'#theform input\').val(\'\');


回答5:

Except for Maxthon Browser I think, they are famous in china and making a name now worldwide. They don\'t treat Autotocomplete=off power very well. It won\'t work with them.



回答6:

Some solution is not working in modern browsers.

Another solution link is given here. which works in all modern browsers.

Input type=password, don't let browser remember the password

You can use autocomplete=\"off\" in this given soluton



回答7:

Matter of fact, both username and password fields doesn\'t react to AutoComplete=off in all the latest browsers.



标签: html forms