Disable autofill in Chrome 63 [duplicate]

2020-05-18 04:22发布

I just updated my browser to Chrome Version 63.0.3239.84 (Official Build) (64-bit).

I then proceeded to go on my website, where I have a input box with autocomplete='off', yet I still get the following:

enter image description here

(You can see my inbuilt suggestion dropdown below it)

This never used to be the case. Nothing else has changed!

Why is this happening? Is this a bug in the new version of chrome? I have tried all other suggestions like autocomplete="false" or applying autocomplete=off to the form too. I have even tried to apply these with jquery after the page has loaded but also no luck.

I have tested this on multiple machines with the newest version of chrome on different operating systems. The issue persists.

15条回答
我只想做你的唯一
2楼-- · 2020-05-18 04:59

I feel terrible how different browsers use different options in a same functionality.

If it's chrome, use autocomplete="disabled" which handles both autocomplete and address based autofill (two separate things):

element.autocomplete = isGoogleChrome() ? 'disabled' :  'off';

You can get some insight on how to writ isGoogleChrome() from here

JavaScript: How to find out if the user browser is Chrome?

查看更多
叼着烟拽天下
3楼-- · 2020-05-18 05:01

Try to remove the "Id" of the input.

That's how i fixed it.

查看更多
啃猪蹄的小仙女
4楼-- · 2020-05-18 05:02

We tried autocomplete="false" and autocomplete="off", neither work. But something Chrome doesn't understand, like autocomplete="disabled", does seem to work. Strange!

Update: this is working as of Chrome 72.

查看更多
唯我独甜
5楼-- · 2020-05-18 05:02

After Chrome 63 it looks like they changed it to autocomplete="disabled"

I recommend you get a browser detecting library and for the rest of it use autocomplete="off"

查看更多
该账号已被封号
6楼-- · 2020-05-18 05:04

I fixed this on my site by replacing the offending input element with

<p class="input" contenteditable="true">&nbsp;</p>

and using jQuery to populate a hidden field prior to submission.

But this is a truly awful hack made necessary by a bad decision at Chromium.

查看更多
迷人小祖宗
7楼-- · 2020-05-18 05:06

As Chrome is never going to work properly and/or keeps changing its mind (I know its not human) the simplest solution to ensure autofill/autocomplete stops is to do the following on any inputs you dont want autofilled:

<input type='text' readonly onfocus="this.removeAttribute('readonly');" value=''/>
查看更多
登录 后发表回答