Dee*_*dhy 18 html browser firefox
我正面临一个浏览器问题:
我创建了2个相同域的登录页面.
我在两个页面中为两个表单添加了不同的表单名称.此外,我还autocomplete = 'off'
为第二个表单和该表单中的文本字段添加了.(但它是第一个表单).
现在,如果我www.testDomain.com/login.cfm
在浏览器中登录时保存用户名和密码,那么即使自动完成关闭,用户名列表也会自动填充在第二个登录页面的用户名字段中.出于安全原因,我需要阻止它.有没有办法做到这一点?我正在使用FireFox V21.
小智 36
$("#CVV").on("focusout", function() {
if ($(this).val() == "") {
$(this).attr("type", "text");
}
});
Run Code Online (Sandbox Code Playgroud)
<input type="text" name="username" class="input" ID="CVV" onfocus="removeErr('CVV'); $(this).attr('type', 'password');">
Run Code Online (Sandbox Code Playgroud)
Bob*_*tor 32
这是我发现阻止Firefox自动完成的最干净的解决方案.
<!-- The text and password here are to prevent FF from auto filling my login credentials because it ignores autocomplete="off"-->
<input type="text" style="display:none">
<input type="password" style="display:none">
Run Code Online (Sandbox Code Playgroud)
将此代码片段添加到您输入的密码类型上方.
据我所知,Firefox正在寻找类型为Password的输入,并填写密码,然后将用户名添加到其上方类型文本的输入中.没有名称或ID,输入不会添加到帖子中,但这仍然是一个黑客.
你们都应该试试这个属性:
<input type="password" autocomplete="new-password" />
请参阅那里的文档:https : //developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion#Preventing_autofilling_with_autocompletenew-password
Aru*_*til -4
将autocomplete="off"添加到表单标签,如 Mozilla 文档中所述
检查以下链接以获取更多信息
归档时间: |
|
查看次数: |
31435 次 |
最近记录: |