禁用Chrome自动填充

旧街凉风 提交于 2020-05-09 09:40:09

问题:

This post is a Community Wiki . 这篇文章是社区维基 Edit existing answers to improve this post. 编辑现有答案以改善此职位。 It is not currently accepting new answers. 它当前不接受新的答案。 Learn more . 了解更多

I have been running into issues with the chrome autofill behavior on several forms. 我一直在遇到几种形式的Chrome自动填充行为问题。

The fields in the form all have very common and accurate names, such as "email", "name", or "password", and they also have autocomplete="off" set. 表单中的所有字段都有非常通用且准确的名称,例如“电子邮件”,“名称”或“密码”,并且还设置了autocomplete="off"

The autocomplete flag has successfully disabled the autocomplete behavior, where a dropdown of values appear as you start typing, but has not changed the values that Chrome auto-populates the fields as. 自动完成标记已成功禁用了自动完成行为,该行为会在您开始键入时出现一个下拉列表,但并未更改Chrome自动将字段填充为的值。

This behavior would be ok except that chrome is filling the inputs incorrectly, for example filling the phone input with an email address. 这种行为是可以的,除了chrome无法正确填写输入内容(例如,用电子邮件地址填充电话输入内容)。 Customers have complained about this, so it's verified to be happening in multiple cases, and not as some some sort of result to something that I've done locally on my machine. 客户对此有所抱怨,因此已证实它是在多种情况下发生的,而不是我在计算机上本地完成的操作的某种结果。

The only current solution I can think of is to dynamically generate custom input names and then extract the values on the backend, but this seems like a pretty hacky way around this issue. 我能想到的唯一当前解决方案是动态生成自定义输入名称,然后在后端提取值,但这似乎是解决此问题的一种很怪异的方法。 Are there any tags or quirks that change the autofill behavior that could be used to fix this? 是否有任何可更改自动填充行为的标记或怪癖可用来解决此问题?


解决方案:

参考一: https://stackoom.com/question/142Et/禁用Chrome自动填充
参考二: https://oldbug.net/q/142Et/Disabling-Chrome-Autofill
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!