自动完成= QUOT;关闭"不工作的谷歌浏览器 [英] autocomplete="off" not working for Google Chrome
问题描述
这个问题已经被问了几次,在过去但不幸的是有没有办法,我可以谷歌浏览器禁用自动填充(v.36.0.1985.125 M)
This question has been asked Several times in the past but unfortunately there's no way i could disable autofill for Google Chrome (v.36.0.1985.125 m)
我已经尝试
<一个href=\"http://stackoverflow.com/questions/18306052/autocomplete-off-not-working-on-google-chrome-browser\">"AutoComplete=Off"不工作的谷歌Chrome浏览
<一个href=\"http://stackoverflow.com/questions/2999578/how-do-i-stop-chrome-from-$p$p-populating-input-boxes\">How我从pre-填入输入框停止铬?
<一个href=\"http://stackoverflow.com/questions/9565486/how-to-disable-google-chrome-suggestion-list-when-using-twitter-bootstrap-typeah\">how当使用禁用谷歌浏览器建议列表Twitter的引导预输入?
code测试至今
<form autocomplete="off">
<asp:textbox autocomplete="off">
AutoCompleteType="Disabled"
但我还是让我的登录页面上autofiled数据。密码被填充即使文本框的ID被改变。
But I still get autofiled data on my login page. Passwords are populated even if Textbox Ids are changed.
推荐答案
最近谷歌浏览器的版本迫使自动填充不论自动完成=关闭
。您要在这里需要破解的点点。一些previous黑客不工作了(34+版本)
Recent Version of Google Chrome are forcing Autofill irrespective of the Autocomplete=off
. You are going to need little bit of hack here. Some of the previous hacks don't work anymore (34+ versions)
我已经测试过继谷歌浏览器V36 code。
它消除了姓名和身份证,从内容属性和1毫秒后分配它们回来。这工作完全在我的情况。
It removes "name" and "id" attributes from elements and assigns them back after 1ms. This works perfectly in my case.
将这个code文件准备好了。
Put this code in document ready.
$(document).ready(function () {
$('form[autocomplete="off"] input, input[autocomplete="off"]').each(function () {
var input = this;
var name = $(input).attr('name');
var id = $(input).attr('id');
$(input).removeAttr('name');
$(input).removeAttr('id');
setTimeout(function () {
$(input).attr('name', name);
$(input).attr('id', id);
}, 1);
});
});;
这篇关于自动完成= QUOT;关闭&QUOT;不工作的谷歌浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!