自动完成=“新密码";在 Windows 中被 Chrome 63 忽略 [英] autocomplete="new-password" ignored by Chrome 63 in Windows

查看:24
本文介绍了自动完成=“新密码";在 Windows 中被 Chrome 63 忽略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 asp.net 站点中有以下测试页面:

I have the following test page in my asp.net site:

<html>
<body>
    <form autocomplete="off">
        <input type="password" name="password" autocomplete="new-password">
    </form>
</body>
</html>

尽管表单的 autocompleteoff 和密码字段的 new-password,Chrome 63.0.3239.132 Windows 仍显示下拉菜单包含可供选择密码的用户列表.

Despite of autocomplete being off for the form and new-password for the password field, Chrome 63.0.3239.132 Windows still shows a dropdown with a list of users to choose a password from.

根据这个,上面应该是足以禁用密码自动完成.如何禁用密码自动完成功能?

According to this, the above should be enough to disable password autocomplete. How can I disable password autocomplete?

推荐答案

Chrome/Chromium 开发人员已确定他们将忽略 autocomplete="off" 值,以支持在网站开发人员所在的消费者网站上提高可用性积极/天真地添加了 autocomplete="off" 属性,以便用户可以轻松地重复使用值.

The Chrome/Chromium developers have determined that they will ignore the autocomplete="off" value in favor of making usability a bit better on consumer sites where the site developer has added the autocomplete="off" attribute aggressively/naively so that users can easily re-use values.

这与规范背道而驰,有几个公开的错误在讨论这个问题,但 Google 似乎不愿意让步.

This flies against the spec and there are several open bugs discussing this but Google doesn't seem willing to budge.

要解决此问题,您需要将所有自动完成属性设置为非预期值.如果您这样做,Chrome 将遵守它们.(好吧,基本上它没有匹配项,所以它不显示任何内容)

To work around this, you will need to set all autocomplete attributes to a non-expected value. If you do this, Chrome will adhere to them. (well, basically it doesn't have a match, so it doesn't show anything)

例如

<!doctype html>
<html>
<body>
  <form autocomplete="do-not-show-ac">
    <input type="password" name="password" autocomplete="do-not-show-ac"/>
  </form>
</body>
</html>

当浏览器供应商不遵守规范时,这很糟糕,但至少对于显示自动完成信息毫无意义的所有场景,或者是公然违反安全的情况,都有一种解决方法.

It sucks when a browser vendor doesn't follow the specs, but at least there is a workaround for all of the scenarios where it makes no sense to display autocomplete info, or is a blatant security violation.

这篇关于自动完成=“新密码";在 Windows 中被 Chrome 63 忽略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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