Firefox有个很方便的功能:记住密码。但是在某些网页上此功能却失效了,登陆时不提示保存密码,下次登录时又得重新输入,在登陆某些设置了较复杂密码的地方特别不方便。
为何会失效呢?其原因是网页作者在 input 中设置了 autocomplete 属性的值为 off
<input type="text" name="pwd" autocomplete="off">
当Firefox发现存在这个属性,就不会记住密码咯。
显然我们不可能通知网站作者去掉这个属性
,但并非没有办法解决。稍稍修改一下Firefox的配置文件即可搞定。
首先找到 nsLoginManager.js 文件。在Firefox安装目录下。例如:
C:\Program Files\Mozilla Firefox\components\nsLoginManager.js
搜索”_isAutoCompleteDisabled”,大约 719 行,可以看见如下片段
/* * _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即可生效
非常谢谢你的方法,我已经引用到了狐狸论坛,呵呵,希望你不要介意哦:
http://www.firefox.net.cn/forum/viewtopic.php?p=208998#208998
另,你的评论回复字体颜色和背景太相似,很累人啊
评论回复的字体颜色已经修改了。一直都没注意到这个地方哈