禁用 Google Chrome 自动完成/自动填充/建议
Disable Google Chrome Autocomplete / Autofill / Suggestion
我想禁用 google chrome 自动完成/自动填充 / 使用密码建议
与自动完成类似的东西="off"(这个不起作用)。
代码如下
loginpage.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>
anotherform.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 自动完成/建议/自动填充?
注意:我知道重复的问题。这些建议中的 none 行得通(因为我现在正在打字)。
谢谢:)
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
我试图混淆浏览器,让它不知道要填写哪个输入字段,这似乎是跨平台的——无法在 explorer thout 上测试它...
试试这个,或者按照这些思路:
<input type="password" class="bigText login" name="hiddenFieldToStopBrowserAutofill" style = "height : 0px; width : 0px; border : 0px"/>
据我所知,只有当您指定与表单中的另一个字段相同的 class 时,它才有效(在这种情况下,我的密码和电子邮件地址都为 "bigText login" )并且然后按照我上面描述的方式让它不可见。如果您尝试使用 "display = none",它将不起作用。
我还尝试了 value = ""、value = " " 等的一些变体,以阻止浏览器用它想要在页面上强制执行的内容替换字符串,但它没有用...保存如果您希望获得更清洁的 opton
,您可以尝试一下
我想禁用 google chrome 自动完成/自动填充 / 使用密码建议
与自动完成类似的东西="off"(这个不起作用)。
代码如下
loginpage.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>
anotherform.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 自动完成/建议/自动填充?
注意:我知道重复的问题。这些建议中的 none 行得通(因为我现在正在打字)。
谢谢:)
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
我试图混淆浏览器,让它不知道要填写哪个输入字段,这似乎是跨平台的——无法在 explorer thout 上测试它...
试试这个,或者按照这些思路:
<input type="password" class="bigText login" name="hiddenFieldToStopBrowserAutofill" style = "height : 0px; width : 0px; border : 0px"/>
据我所知,只有当您指定与表单中的另一个字段相同的 class 时,它才有效(在这种情况下,我的密码和电子邮件地址都为 "bigText login" )并且然后按照我上面描述的方式让它不可见。如果您尝试使用 "display = none",它将不起作用。
我还尝试了 value = ""、value = " " 等的一些变体,以阻止浏览器用它想要在页面上强制执行的内容替换字符串,但它没有用...保存如果您希望获得更清洁的 opton
,您可以尝试一下