Google Chrome自动填充所有密码输入 [英] Google chrome autofilling all password inputs

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

问题描述

我的问题

我必须打开google才能在我的网站上自动填充登录名,但是现在我想编辑我的帐户信息或编辑其他用户的帐户信息(以管理员身份)时,它都试图自动填充该登录名数据.它把我的数据填入了奇怪的地方.问题似乎在于,Chrome浏览器会自动用一种密码类型填充所有输入内容,然后自动输入(请参见下图).如果我在其前面放一个选择框,则它不会自动填充.

I must have turned on google to autofill for a login on my site, however it is trying to now autofill that login data whenever I want to edit my account info or edit another users account info (as an admin). It fills in my data in weird spots. The issue seems to be that Chrome auto fills any input with a type of password and then whatever the input before it is (see image below). If I put a select box before it then it won't autofill.

显然,我不想每次编辑用户时都要经过一次删除密码/电话的操作.我也不希望我的用户在编辑自己的帐户时必须这样做.如何删除它?

I obviously don't want to have to go through and delete the password/phone every time I edit a user. I also don't want my users to have to do that when they are editing their own account. How do I remove it?

我尝试过的事情 (没有成功)

  • 在表单以及电话和密码输入中添加autocomplete ="off".
  • 为两个输入均添加value ="
  • 更改密码输入的名称=.我尝试了密码,通行证,密码和起司(以防chrome捡起了名字)
  • 通过jatt.attr添加autocomplete ="off"

我发现的东西

我发现Google可能有意忽略自动完成功能:

I found that Google may be intentionally ignoring autocomplete: Google ignoring autocomplete

我发现另一个用户发布了类似的问题,但该解决方案不适用于我:禁用Chrome自动填充

I found another user posting a similar question but the solution is not working for me: Disable Chrome Autofill

我还发现另一个用户正在做一个工作,涉及创建一个隐藏的密码字段,该字段将采用Google自动填充功能,因此,我希望使用一种更简洁的解决方案,因为在我的情况下,我还需要一个隐藏的输入,以避免两者自动填充:在不禁用自动填充功能的情况下禁用chrome自动填充

I also found another user doing a work around involving creating a hidden password field which would take the google autocomplete, I'd prefer a cleaner solution as in my case I would also need a hidden input above it to avoid both from autofilling: Disable autofill in chrome without disabling autocomplete

推荐答案

在具有自动完成属性的HTML5中,有一个名为"new-password"的新属性,我们可以使用它来解决此问题.以下为我工作.

In HTML5 with autocomplete attribute there is a new property called "new-password" which we can use to over come this issue. Following works for me.

<input id="userPassword" type="password" autocomplete="new-password">

当前密码: 允许浏览器或密码管理器输入该站点的当前密码.它提供了比启用"更多的信息,因为它使浏览器或密码管理器知道使用该字段的当前已知密码,而不是新密码.

current-password : Allow the browser or password manager to enter the current password for the site. This provides more information than "on" does, since it lets the browser or password manager know to use the currently-known password for the site in the field, rather than a new one.

新密码: 允许浏览器或密码管理器自动输入该站点的新密码.这可能是根据控件的其他属性自动生成的,或者可能只是告诉浏览器提供某种建议的新密码"小部件.

new-password : Allow the browser or password manager to automatically enter the new password for the site. This might be automatically generated based on the other attributes of the control, or might simply tell the browser to present a "suggested new password" widget of some kind.

引用: https://developer.mozilla. org/zh-CN/docs/Web/HTML/Element/input/password

这篇关于Google Chrome自动填充所有密码输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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