Chrome自动将用户名填充为随机文本输入 [英] Chrome autofills username into random text input
问题描述
这是在使用Chrome版本72.0.3626.109(官方内部版本)(64位)的asp.net网络表单应用程序上发生的.
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表单中.
The answer is to add an invisible text input to the asp.net form called "username".
几年前,我们在输入不同的内容时遇到了同样的问题.答案是添加一个不可见的类型为"password"的输入,如该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...":
下面是完整的修复程序,我在我们网站的主页中的form元素内添加了这两个元素.根据下面的@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屋!