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 05:08

2019 It seems autocomplete="disabled" works again as of Chrome 72.


SINCE A LOT OF PEOPLE HAVE BEEN DOWNVOTING WITHOUT READING THE COMMENTS: THIS NO LONGER WORKS IN CHROME AS OF 2018 / CHROME 63+ relevant: https://bugs.chromium.org/p/chromium/issues/detail?id=587466

Having autocomplete="false" instead of autocomplete="off" works, you can read more from the Chrome team as to why they did it


here:

https://www.chromium.org/developers/design-documents/form-styles-that-chromium-understands https://bugs.chromium.org/p/chromium/issues/detail?id=468153 https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/zhhj7hCip5c https://developers.google.com/web/updates/2015/06/checkout-faster-with-autofill

查看更多
一夜七次
3楼-- · 2020-05-18 05:14

I've managed to get a working "hack" in Chrome Version 65.0.3325.162 (Official Build) (64-bit).

I have to render an input field - hidden so it doesn't affect my page:

<input style="display:none;"/>

Then I render my password input field:

<input type="password" autocomplete="new-password" />

So my form ends up looking like:

<form>
    <input style="display:none;" />
    <input type="password" autocomplete="new-password" />
    <input type="submit" />
</form>

Importantly, you cannot add a name or an id attribute to your password type input element, and you must have autocomplete="new-password"

查看更多
成全新的幸福
4楼-- · 2020-05-18 05:17

Looks like chrome looks for the closest "label" html tag to the input, and analyzes the label's value/html to affect the input's autofill.

The cleanest workaround I found to disable the input's autofill was this:

<label for="">Country</label>
<label for="" style="display: none;">hidden label to mislead chrome autocomplete</label>
<input ... />
查看更多
登录 后发表回答