谷歌浏览器自动填充所有密码输入 [英] Google chrome autofilling all password inputs

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

问题描述

我的问题

我必须打开 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 取名)
  • 通过 jquery .attr 添加 autocomplete="off"

我发现了什么

我发现 Google 可能故意忽略自动完成功能: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

我还发现另一位用户正在做一个涉及创建隐藏密码字段的工作,该字段将采用谷歌自动完成,我更喜欢更简洁的解决方案,因为在我的情况下,我还需要在其上方隐藏输入以避免自动填充: 在不禁用自动完成的情况下禁用 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">

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

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/en-US/docs/Web/HTML/Element/input/password

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

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