简体   繁体   English

意外的 Chrome 自动填充行为 [禁用 chrome 自动填充]

[英]Unexpected Chrome Autofill Behaviour [disable chrome autofill]

So like everyone else before me I am trying to disable chrome autofill.所以像我之前的其他人一样,我正在尝试禁用 chrome 自动填充。

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, eg 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.但是,用户代理不应允许用户轻易地将自动填充字段名称从“off”更改为“on”或其他值,因为如果始终记住所有值,无论站点的偏好如何,都会对用户产生重大的安全隐患。

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.自动完成是不同的,但我仍然看到它,它来自 chrome。 ( I disabled my extensions , only turning autofill off in chrome settings prevented the autocomplete from showing up ) 我禁用了我的扩展程序只有在 chrome 设置中关闭自动填充功能才能阻止自动完成功能出现

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.在相同形式的另一个输入中, autocomplete="off"有效,而autocomplete="radnomString!23123adf"无效。 Setting autocomplete attribute to the form element didn't help.form元素设置autocomplete属性没有帮助。 autocomplete="new-password" also didn't help. autocomplete="new-password"也没有帮助。

作为随机字符串自动完成

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.从最近的 Chrome(肯定是 70 版)开始,只要您的输入看起来不像用户个人资料、地址或信用卡数据,就可以使用autocomplete="off"

On the other hand, values such as disabled , nope or random strings appear to be ignored.另一方面,诸如disablednope或 random 字符串之类的值似乎被忽略了。

It is likely Chrome is ignoring the autocomplete element because your input name is individualName . Chrome 可能会忽略自动完成元素,因为您的输入名称是individualName The autofill logic is done server-side by Google, so there are lots of heuristics involved.自动填充逻辑是由 Google 在服务器端完成的,因此涉及很多启发式方法。

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.为了稍微增加 rjh 的答案,Chrome 不仅仅查看您要禁用自动完成功能的字段的名称/ID。 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.因此,如果您有“名称:[txtRandomStringTextBox]”,它会假定 [txtRandomStringTextBox] 实际上是一个名称,它会继续推荐自动填充。 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.虽然他们目前在 Chrome 70 .0.3538.102 中的实现不那么烦人,但如果能完全解决这个问题会很好。

I had same problem on windows Chrome.我在 Windows Chrome 上遇到了同样的问题。
Chrome ignored my settings about autocomplete and do evil things. Chrome 忽略了我关于自动完成的设置并做坏事。

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.在我的电脑用Chrome version 70+做工精细用新的保存的密码,但对计算机其中有之前创建密码Chrome version 70不按预期方式工作。
After created new and delete password and other many things with settings and whatever, my fellow clear Chrome cache from AppData.在创建新密码和删除密码以及其他许多设置和其他内容之后,我的同事从 AppData 清除了 Chrome 缓存。 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.它似乎在 Chrome 70 中具有新功能respect autocomplete=off更改respect autocomplete=off不会使用旧存储的密码刷新缓存。 (THX for info @rjh) (感谢信息@rjh)

SOLUTION IS DELETE CHROME CACHE FROM解决方案是删除 Chrome 缓存

C:\Users\<yourUser>\AppData\Local\Google\Chrome

Hope it helps.希望能帮助到你。

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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM