autocomplete =“新密码"; Windows中的Chrome 63会忽略 [英] autocomplete="new-password" ignored by Chrome 63 in Windows

查看:105
本文介绍了autocomplete =“新密码"; 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>

尽管autocomplete在表单中为off,在密码字段中为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.

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

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