如何防止自动完成"使用密码:"选项在chrome?

[英]How do I prevent auto complete “Use password for:” option in chrome?


This is the example:

这是例子:

https://drive.google.com/file/d/0B4CwNQ_rOoDVUVZSY3h0QXVBaG8/view

https://drive.google.com/file/d/0B4CwNQ_rOoDVUVZSY3h0QXVBaG8/view

<asp:TextBox ID="TextBoxPassword" runat="server" TextMode="Password" autocomplete="off"></asp:TextBox>

I want to prevent the password autocomplete in my system. It seems it is not working with autocomplete="off". I could prevent it using $('#<%= TextBoxPassword.ClientID %>').val(""); when the window is loading, but in Chrome there is a another option call Use password for: and someone can get the password by using that. So how do I prevent it?

我想防止密码在我的系统中自动完成。它似乎并不是与autocomplete="off"一起工作。我可以使用$('#<%= TextBoxPassword)来防止它。ClientID % >).val(" ");当窗口被加载时,Chrome中有另一个选项叫Use password for:有人可以通过使用它来获取密码。那么我该如何预防呢?

I don't mean the "yellow background" thing that belongs to chrome.

我指的不是属于chrome的“黄色背景”。

2 个解决方案

#1


2  

In IE you need to do like this:

在IE中你需要这样做:

<asp:TextBox ID="TextBoxPassword" runat="server" AutoCompleteType="Disabled"></asp:TextBox>

In all other browsers, this:

在所有其他浏览器中,如下:

<asp:TextBox ID="TextBoxPassword" runat="server" autocomplete="Off"></asp:TextBox>

Im pretty sure you need the 'off' to be: 'Off'

我很确定你需要" off "来表示" off "

In HTML, as you mention you can use the;

在HTML中,正如您提到的,您可以使用;

<form action="demo_form.asp" autocomplete="on">
  First name:<input type="text" name="fname"><br>
  Last name: <input type="text" name="lname"><br>
  E-mail: <input type="email" name="email" autocomplete="off"><br>
  <input type="submit">
</form

Either on the form or the input itself.

要么在表单上,要么在输入本身上。

Maybe something else in your code is enabling it again?

也许你的代码中还有别的东西在支持它?

Hope this works. Just tested and had no problem. Both IE and Chrome.

希望这个工作。刚刚测试,没有问题。IE和铬。

#2


13  

Use autocomplete="new-password", as per the specs.

按照说明使用autocomplete=“new-password”。


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.itdaan.com/blog/2015/04/22/3a6be306fc67384e3de28a2548d09b15.html



 
© 2014-2019 ITdaan.com 粤ICP备14056181号