加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 资源网站 > 资源 > 正文

html – 如何在Firefox中的登录/密码字段中使autocomplete = of

发布时间:2020-12-14 19:46:07 所属栏目:资源 来源:网络整理
导读:我想阻止浏览器存储和显示输入值.这就是我这样做的方式: 但是由于一些疯狂的原因,即使我完全清除浏览器历史记录,浏览器也会继续存储和显示值.所以,我想知道为什么autocomplete =“off”不起作用.可能还有另一种更合适的方法. PS.我不确定它是否重要,但我使

我想阻止浏览器存储和显示输入值.这就是我这样做的方式:

但是由于一些疯狂的原因,即使我完全清除浏览器历史记录,浏览器也会继续存储和显示值.所以,我想知道为什么autocomplete =“off”不起作用.可能还有另一种更合适的方法. PS.我不确定它是否重要,但我使用jquery来构建我的表单.

编辑

顺便说一句,与官方W3C documentation相反,在HTML5中,autocomplete =“off”不受尊重(至少在FF中).

最佳答案
从https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion#The_autocomplete_attribute_and_login_fields开始:

[…] many modern browsers do not support autocomplete=”off” for login fields.

  • if a site sets autocomplete=”off” for a form,and the form includes 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 this page.
  • if a site sets autocomplete=”off” for username and password input fields,the browser will autofill those fields the next time the user visits this page.

虽然这背后的推理是值得商榷的,但这是预期的行为.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读