6 ms·
This has turned into a sad chicken-race between Google and developers, with lots of innovative workarounds on Stackoverflow. Their tactic of overruling web dev
by sandstrom 7y ago
This has turned into a sad chicken-race between Google and developers, with lots of innovative workarounds on Stackoverflow.
Their tactic of overruling web developers doesn't work, it only make things more complicated for everyone, since many of the workarounds have other negative side-effects.
https://stackoverflow.com/questions/12374442/chrome-ignores-autocomplete-off https://stackoverflow.com/questions/12374442/chrome-ignores-...
## Example 1
For a reliable workaround, you can add this code to your layout page:
<div style="display: none;">
<input type="text" id="PreventChromeAutocomplete"
name="PreventChromeAutocomplete" autocomplete="address-level4" />
</div>
Chrome respects autocomplete=off only when there is at least
one other input element in the form with any other autocomplete value.
## Example 2
Simply make your input readonly, and on focus, remove it. This is a very
simple approach and browsers will not populate readonly inputs.
Therefore, this method is accepted and will never be overwritten by
future browser updates.
<input type="text" onfocus="this.removeAttribute('readonly');" readonly />
Style your input accordingly so that it does not look like a readonly input.
## Example 3
Tell Chrome that this is a new password input and it won't provide
old ones as autocomplete suggestions:
<input type="password" name="password" autocomplete="new-password">
- obituary_latte 7y agoI think it mentioned chrome is even now ignoring ‘display:none’ and ‘visibility:hidden’ declarations so those workarounds no longer work either.
- msclrhd 7y agoGreat! :( Now I need to recheck to see if an autocomplete bug has reappeared where it thinks an email address field is a username field in a change password UI and autocompletes the email address with the username from the login page. Sigh!
- obituary_latte 7y agoI feel your pain - sorry you have to deal with it. I’m working on a client data management app and I’m having issues everywhere with this. It’s been an open ticket on Jira for months!
- identity0 7y agoWhy would they ever do that. That’s just asking for autofill phishing.
- EugeneOZ 7y agoI haven't tried it, but maybe div with "contenteditable" could help?
- notatoad 7y agoThis is what I resorted to on one of our internal tools that wants a phone number to be entered and kept getting auto-completed with our staff'S phone numbers. I wouldn't recommend it for public use. There's a lot of subtle behaviour around an input field that you'd need to replicate manually.
- scient 7y agoPreach. Them changing the rules and overriding the usage of this attribute is ridiculously stupid in the first place. HTML attributes are there for a reason, developers are supposed to be able to use them and they are supposed to work as expected. But in order to push their password management and form filling functionality, they just give everyone a finger.
- pas 7y agoAt the same time many many many dumb corp-o-rat shit sites disable autocomplete because cOmpLiEncE. And users love autocomplete... Naturally the problem is choice. Chrome/G should show a button to auto fill fields. They could simply unleash some AI magic, train a network to recognize good and bad sites, etc. (Aka. the Apple way. As they also have a we know better policy, and users seem to love that.)
- rc_mob 7y agoI still don’t understand why any self respecting developer would use Chrome. I understand why your grandma or parents would use Chrome. But I just cannot compute how a knowledgeable developer would install Chrome.
- danso 7y agoBecause Chrome has 70% of the global market share, and web developers should know what their customers use?
- mfer 7y agoWhen IE had a huge market share I would use and build with chrome then test and correct in IE. It’s possible to support clients while not personally supporting this.
- Gibbon1 7y agoDevelopers need to understand this is war and act accordingly.
- brokensegue 7y agoThis is not "war". Don't overdramatize.
- Gibbon1 7y agoDon't be toxic and rude.
- breakingcups 7y agoSomeone disagreeing with you is not "toxic".
- Gibbon1 7y ago> Don't overdramatize Is toxic.
- clairity 7y ago> “ This has turned into a sad chicken-race...” great dash use! i almost read that as a race of sad chickens (seriously) but the dash autocorrected me. bravo!