Firefox
有个很方便的功能:记住密码。但是在某些网页上此功能却失效了,登陆时不提示保存密码,下次登录时又得重新输入,在登陆某些设置了较复杂密码的地方特别不方便。
为何会失效呢?其原因是网页作者在 input 中设置了 autocomplete 属性的值为 off
- <
input
type
=
"text"
name
=
"pwd"
autocomplete
=
"off"
>
<input type="text" name="pwd" autocomplete="off">
当Firefox发现存在这个属性,就不会记住密码咯。
显然我们不可能通知网站作者去掉这个属性
,但并非没有办法解决。稍稍修改一下Firefox的配置文件即可搞定。
首先找到 nsLoginManager.js 文件。在Firefox安装目录下。例如:
C:/Program Files/Mozilla Firefox/components/nsLoginManager.js
搜索”_isAutoCompleteDisabled”,大约 719 行,可以看见如下片段
-
<br>
- _isAutocompleteDisabled : function
(element) {<br>
- if
(element && element.hasAttribute(
"autocomplete"
) &&<br>
- element.getAttribute("autocomplete"
).toLowerCase() ==
"off"
)<br>
- return
true
;<br>
- <br>
- return
false
;<br>
- },
/*
* _isAutoCompleteDisabled
*
* Returns true if the page requests autocomplete be disabled for the
* specified form input.
*/
_isAutocompleteDisabled : function (element) {
if (element && element.hasAttribute("autocomplete") &&
element.getAttribute("autocomplete").toLowerCase() == "off")
return true;
return false;
},
将倒数第三行的 return true; 修改为 return false;
保存,重启Firefox即可生效。