Reputation: 5226
So like everyone else before me I am trying to disable chrome autofill.
This explained to me why autocomplete off does not work:
A user agent may allow the user to override an element's autofill field name, e.g. to change it from "off" to "on" to allow values to be remembered and prefilled despite the page author's objections, or to always "off", never remembering values. However, user agents should not allow users to trivially override the autofill field name from "off" to "on" or other values, as there are significant security implications for the user if all values are always remembered, regardless of the site's preferences.
This should be the solution:
In some case, the browser will keep suggesting autocompletion values even if the autocomplete attribute is set to off. This unexpected behavior can be quite puzzling for developers. The trick to really force the no-completion is to assign a random string to the attribute
Default behavior
This is expected.
Autocomplete off
This is also expected.
Autocomplete as random string
The autocomplete is different but I still see it and it is coming from chrome. (I disabled my extensions, only turning autofill off in chrome settings prevented the autocomplete from showing up)
Can anyone please explain what is happening and how do I finally get rid of it? 🤯
EDIT:
In another input in the same form autocomplete="off"
works and autocomplete="radnomString!23123adf"
does not work. Setting autocomplete
attribute to the form
element didn't help. autocomplete="new-password"
also didn't help.
Upvotes: 7
Views: 5211
Reputation: 363
To prevent autofill (not autocomplete), I used the following trick:
<form>
<input
name="username"
type="text"
style="opacity: 0; position: fixed; width: 0; height: 0"
/>
<input
type="password"
style="opacity: 0; position: fixed; width: 0; height: 0"
/>
<input name="username" type="text" />
<input type="password" />
</form>
Upvotes: 0
Reputation: 2788
I had same problem on windows Chrome.
Chrome ignored my settings about autocomplete and do evil things.
On my computer with Chrome version 70+
work fine with new saved passwords but on computer which had passwords created before Chrome version 70
not work as expected.
After created new and delete password and other many things with settings and whatever, my fellow clear Chrome cache from AppData. Now it works as expected like computer one.
Its seem like changes in Chrome 70 with new feature respect autocomplete=off
does not refresh cache with old stored passwords. (THX for info @rjh)
SOLUTION IS DELETE CHROME CACHE FROM
C:\Users\<yourUser>\AppData\Local\Google\Chrome
Hope it helps.
Upvotes: 0
Reputation: 56
To add slightly to rjh's answer, Chrome isn't just looking at the name / id of the field you are looking to disable autocomplete. It is looking at the text near the text box. So if you have "Name: [txtRandomStringTextBox]" it will assume [txtRandomStringTextBox] is actually a name and it will continue to recommend autofill. Not sure of a work around for this.
Although their current implementation in Chrome 70 .0.3538.102 is less annoying, it would be nice if this was fully addressed.
Upvotes: 3
Reputation: 50324
As of recent Chrome (definitely version 70) autocomplete="off"
is now respected, as long as your inputs do not look like user profile, address or credit card data.
On the other hand, values such as disabled
, nope
or random strings appear to be ignored.
It is likely Chrome is ignoring the autocomplete element because your input name is individualName
. The autofill logic is done server-side by Google, so there are lots of heuristics involved.
Upvotes: 5