html - 禁用 Google Chrome 自动完成/自动填充/建议

标签 html google-chrome autocomplete autofill

<分区>

我想禁用 google chrome 自动完成/自动填充/使用密码建议
与 autocomplete="off"类似的东西(这个不起作用)。

代码如下

登录页面.php

<form class="form-method" method="post">
    <span class="form-fill">
      <text>Username</text>
      <input placeholder="Username" required/>
      <text>Password</text>
      <input type="password" placeholder="Password" required/>
      <button type="submit"></button>
    </span>
</form>

另一个表单.php

<form method="REQUEST" class="vp-method">
    <input type="password" maxlength="4" autocomplete="JUST STOP!"/>
    <button type="submit" placeholder="DVN Number">Validate</button>
</form>


如何在不使用 javascript 的情况下禁用此 google chrome 自动完成/建议/自动填充?

注意:我知道重复的问题。这些建议都不起作用(因为我现在正在打字)。

谢谢你:)

最佳答案

Chrome 不再支持 autocomplete="off"。请改用autocomplete="new-password"
Mozilla link

来自文档:

For this reason, many modern browsers do not support autocomplete="off" for login fields:

If a site sets autocomplete="off" for username and password input fields, then the browser will still offer to remember this login, and if the user agrees, the browser will autofill those fields the next time the user visits the page. This is the behavior in Firefox (since version 38), Google Chrome (since 34), and Internet Explorer (since version 11).

If an author would like to prevent the autofilling of password fields in user management pages where a user can specify a new password for someone other than themself, autocomplete="new-password" should be specified, though support for this has not been implemented in all browsers yet.

另一种解决方案是使用 autocomplete="false"。以下是一些可能有帮助的其他 SO 问题的链接:

SO - Disabling Chrome Autofill

SO - Chrome Browser Ignoring AutoComplete=Off

SO - Chrome 63+ Autocomplete Bypass

关于html - 禁用 Google Chrome 自动完成/自动填充/建议,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43783924/

相关文章:

ios - 在 iOS 中获取街道名称

javascript - html5 Canvas 图像移动问题

javascript - View 切换时完整日历中断

JavaScript 无法在 Firefox/IE 中运行,但可以在 Chrome 中运行

css - 移动浏览器上页脚图像的一个像素位移?

c# - 当数据来自数据库时,自动完成 jquery 插件不起作用?

php - 帮助获取传递到 Jquery 自动完成插件的正确信息以获得可点击的结果

jquery - CSS - 根据背景更改文本颜色

html - css 代码不适用于 ionic 2 中的按钮

google-chrome - 运行 vscode chrome 调试器扩展的 vscode gulp/grunt 脚本