Chrome 将用户名自动填充到随机文本输入中 [英] Chrome autofills username into random text input

查看:49
本文介绍了Chrome 将用户名自动填充到随机文本输入中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是在使用 Chrome 版本 72.0.3626.109(官方版本)(64 位)的 asp.net webforms 应用程序上发生的.

This is happening on an asp.net webforms application, using Chrome Version 72.0.3626.109 (Official Build) (64-bit).

该站点受密码保护.用户使用用户名和密码登录.成功登录后,用户将被重定向到贷款搜索"页面.贷款搜索页面包含一些文本输入.

The site is password-protected. The user logs in with a username and password. After a successful login the user is redirected to the "Loan Search" page. The Loan Search page contains a handful of text inputs.

问题是 Chrome 会将我的用户名自动填充到其中一个文本输入中(见图).tregan"是我在登录页面输入的用户名.

The problem is Chrome will autofill my username into one of the text inputs (see image). "tregan" is the username I entered into the login page.

Chrome 始终选择此特定文本输入来自动填充用户名(联系邮寄地址").这发生在我自己和我们网站的其他几十个用户身上.

Chrome always selects this particular text input to autofill the username ("Contact Mailing Address"). This is happening to myself and several dozen other users of our web site.

知道为什么 Chrome 会进行这种自动填充,我能做些什么来阻止它吗?我清除了 Chrome 自动填充缓存,但这并没有解决问题.

Any idea why Chrome is doing this autofill, and is there anything I can do to prevent it? I cleared my Chrome autofill cache, but that did not fix the problem.

推荐答案

答案是在asp.net表单中添加一个不可见的文本输入,名为username".

The answer is to add an invisible text input to the asp.net form called "username".

几年前,我们在使用不同的输入时遇到了同样的问题.答案是添加一个密码"类型的不可见输入,如此 SO 答案中所述,向下滚动到短语它是如此简单和棘手......":

Several years ago we were having the same problem with a different input. The answer was to add an invisible input of type "password", as explained in this SO answer, scroll down to the phrase "It is so simple and tricky...":

禁用 Chrome 自动填充

以下是完整的修复,我在我们网站母版页的表单元素中添加了这两个元素.根据下面@Jeff_Mergler 的评论,将这些输入放在表单标签的顶部:

Below is the complete fix, I added these two elements inside the form element in our site's master page. Per @Jeff_Mergler's comment below, put these inputs at the top of your form tag:

<input type="text" id="username" style="width:0;height:0;visibility:hidden;position:absolute;left:0;top:0" />
<input type="password" style="width:0;height:0;visibility:hidden;position:absolute;left:0;top:0" />

这篇关于Chrome 将用户名自动填充到随机文本输入中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆