我想禁用 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