chrome浏览器不允许记忆登录账户的方法

autocomplete方法

https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion#The_autocomplete_attribute_and_login_fields

对于普通的表单区域 此属性设置为 off,具有阻止浏览器记忆的功能

Setting autocomplete="off" here has two effects:

  • it stops the browser saving field data for later autocompletion on similar forms though heuristics that vary by browser.

  • it stops the browser caching form data in session history. When form data is cached in session history, the information the user has filled in will be visible after the user has submitted the form and clicked on the Back button to go back to the original form page.

但是对于登录页面,不行。

The autocomplete attribute and login fieldsEdit

Modern browsers implement integrated password management: when the user enters a username and password for a site, the browser offers to remember it for the user. When the user visits the site again, the browser autofills those login fields with the stored values.

Additionally, the browser enables the user to choose a master password that the browser will use to encrypt stored logins.

Even without a master password, in-browser password management is generally seen as a net gain for security. Since users don‘t have to remember passwords that the browser stores for them, they are able to choose stronger passwords than they would otherwise.

For this reason, 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, 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.

This is the behavior in Firefox (since version 38), Google Chrome (since 34), and Internet Explorer (since version 11).

登录页面规避记忆方法

http://www.cnblogs.com/happyfreelife/p/4240100.html

此博文推荐在 密码框前 添加一个隐藏的 密码框:

<input type="password" style="display: none;">

和ajax提交。

http://blog.csdn.net/nms312/article/details/39050419

此博文推荐在聚焦的时候 才改变输入框类型为password

<input type="text" name="password" onfocus="this.type=‘password‘" autocomplete="off"/>

http://blog.csdn.net/ldevs/article/details/39671813

此博文推荐在提交前将密码框清空, 实际提交的密码使用隐藏的 hidden控件。

此法逻辑上更加自然, 引入一个提交用的隐藏控件, 清空可见控件,并改变可见控制内容为空。 推荐!!

很多浏览器都会记住用户密码,如果偶尔在一台机器上登录系统密码容易被记住,别人能轻松登录,通过以下方法可以轻松防止密码被浏览器记住,被他人非法使用

1、使用随机数生成方式生成一个随机数加上前缀生成一个密码输入框的id

id 如 PWD_12332

<input type="password" id="PWD_12332" />

每次都是不同的id做密码框的id

2、实际密码提交的文本框隐藏

<span style="font-size:18px;"><input id="password" name="password" type="hidden" /></span>

3、表单提交前将 密码输入框的内容 搬到隐藏的文本框中

4、清空密码输入框,清空密码框后浏览器应该没东西记了。

下一次登录时密码框的id会改变,谁也不知道是什么,浏览器能知道吗,大家可以试试!!!

验证代码

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.js"></script>

</head>
<body>
  <form action="index.php">
    <input type="text" > user
    <input type="password"> password
    <button type="submit">submit</button>
  </form>
  <script>
    $("[type=‘submit‘]").click(function  () {
     
      alert($("[type=‘password‘]").val())

$("[type=‘password‘]").val("") //将密码赋值为 空,则不会触发chrome记忆

alert($("[type=‘password‘]").val())

//return false
    })
  </script>
</body>
</html>

时间: 2024-08-26 13:06:04

chrome浏览器不允许记忆登录账户的方法的相关文章

chrome浏览器默认启动时打开2345导航的解决方法

2345并没有修改chrome内部设置,它只是把所有的快捷方式修改了,包括开始菜单旁边的快捷启动图标. 只需要右键chrome快捷方式,在目标一栏中,把"----chrome.exe"引号后面的所有东西删除,然后确定,就不会再有问题了.开始菜单旁边的小chrome图标一样方法都可以解决... 而若在更改目标位置时出现需要一"您的权限不足,请点击继续来获得权限." 解决方法: 对计算机图标,击右键,选择管理. 开界面后,选择本地用户和组,单击用户,选择administ

在CMD下启动vmware、Xshell连接虚拟机以及控制Chrome浏览器自动执行js登录校园网

标题有点长,主要是写个bat出来玩玩, (1)不用每次都手动关闭mysql服务(我不想把它设为手动启动,有强迫症) (2)然后希望每次vmware能自动连上虚拟机 (3)以及每次Xshell都能自动启动,然后就连上虚拟机 (4)然后校园网每次都要打开,输入帐号密码什么的,才能连网,我希望它自己搞定 做完了这几步还是有点意思的,主要是浏览器还是网页的什么自动化测试,然后eclipse下项目打包成可执行的jar包 现在听我娓娓道来吧! 前面要达到的目的跟着后面的命令并无关联 (1)首先在bat里面关

解决win8下chrome浏览器打开提示没有注册类的方法

今天又把win8装回来了,继续装了个chrome浏览器,但是发现只能从安装的文件打开,从快捷方式或者快速启动栏都会提示没有注册类.找到一种解决的办法是删除注册表中的相关键值,具体如下: 1.打开注册表HKEY_CLASSES_ROOT,然后依次打开如下: 把command打开,,把这一项的键值删掉,注意仅仅是删掉键值,不能把这个项删掉.然后就OK了!

chrome浏览器手动添加Proxy SwitchySharp插件的方法

在学习谷歌Chrome浏览器FQ技术时,很多人反应安装了Chrome浏览器后进入不了不了应用商店(因某种不可抗拒因素造成),从而导致安装不了Proxy SwitchySharp插件.创想针对这个问题撰写文章说明手动添加了Proxy SwitchySharp插件的办法供大家参阅. 1.下载提供的了Proxy SwitchySharp插件. 2.打开Chrome浏览器应用商店(chrome://extensions/),然后把插件拖入即可完成安装,如图所示. 然后倒入解压出来的文件SwitchyOp

chrome 浏览器 手动同步书签 && 安装离线插件

现在查的很严,所以使用chrome浏览器 同步功能不是特别好,就算是FQ也会出现 同步延迟的情况,所以定时使用手动同步还是很靠谱的行为,就在网上找了下,借鉴下.亲测可用. 在Chrome浏览器没有一个提交和Google账户进行同步的按钮,不过使用中发现可以在Chrome的"设置"--"个人资料"--"登录"项里面的"高级"项,点击后出现的对话框中有个"使用默认设置",这个按钮其实就相当于手动提交同步的按钮,

Chrome浏览器扩展开发系列之八:Chrome扩展的数据存储

Google Chrome浏览器扩展可以使用如下任何一种存储机制: HTML5的localStorage API实现的本地存储(此处略) Google的chrome.storage.* API实现的浏览器存储 Google的chrome.cookies.* API实现的cookie存储 1) chrome.storage API实现的浏览器存储 Chrome浏览器扩展通过chrome.storage.* API,可以存取数据或监听数据的变化. 在manifest.json文件中注册storage

Google Chrome 浏览器必备扩展(适用于 Brave 和 Vivaldi 等)

// 前提 不同身份不同状态的人们,总是有着不同的上网需求! 浏览器插件,可以大大的扩展浏览器的功能,实现我们的上网需求. 访问 Chrome Web Store 浏览扩展,看到喜欢的就下载试试吧,没有用就立刻删掉吧. (不能访问 Chrome Web Store ,可以搜索 "谷歌访问助手" 或 "蓝灯" 的使用方法) (音乐:Are You Lonely) 下面 根据使用需求,对常用插件进行分类显示: 广告 用户诉求:摆脱烦人广告.恶意软件和跟踪,还我一个清爽网

如何查看Chrome浏览器保存的账号密码?

最近使用了chrome自动生成的密码,一时着急怎么也想不起来,就想到Chrome中保存了密码,怎样从Chrome浏览器中查看到已经保存的密码呢,下面就来看一看.某种意义上上,查看Chrome的密码比查看IE的更简单,因为查看IE密码还需要借助第三方工具,而查看CHrome密码只需一段简单的代码就行-- 查看Chrome密码只需一段代码 在Chrome浏览器的地址栏里输入" chrome://chrome/settings/passwords ",然后Chrome自动帮你保存的密码就会瞬

Ubuntu 14.04 LTS下安装Google Chrome浏览器

在Ubuntu 14.04下安装Google Chrome浏览器非常简单,只要到Chrome的网站下载Deb安装包并进行安装即可.当然你也可以使用APT软件包管理器来安装Google Chrome浏览器,如果你想使用APT软件包管理器安装Google Chrome浏览器的话,本文将介绍这两种方法. 目前Linux下的Google Chrome浏览器有三个版本,稳定版.Beta(测试版)和Unstable(不稳定版,也就是Dev版).其中Beta相对较稳定,而最新的功能将会先出现在Unstable