зеркало из https://github.com/mozilla/pjs.git
Bug 374723: re-design password manager API and implement in JS rather than C++, patch by Justin Dolske <dolske@mozilla.com>, r=mconnor, r=me
This commit is contained in:
Родитель
21ff70bf1d
Коммит
9a3e5ff87f
|
@ -194,24 +194,17 @@ Sanitizer.prototype = {
|
|||
passwords: {
|
||||
clear: function ()
|
||||
{
|
||||
var pwmgr = Components.classes["@mozilla.org/passwordmanager;1"]
|
||||
.getService(Components.interfaces.nsIPasswordManager);
|
||||
var e = pwmgr.enumerator;
|
||||
var passwds = [];
|
||||
while (e.hasMoreElements()) {
|
||||
var passwd = e.getNext().QueryInterface(Components.interfaces.nsIPassword);
|
||||
passwds.push(passwd);
|
||||
}
|
||||
|
||||
for (var i = 0; i < passwds.length; ++i)
|
||||
pwmgr.removeUser(passwds[i].host, passwds[i].user);
|
||||
var pwmgr = Components.classes["@mozilla.org/login-manager;1"]
|
||||
.getService(Components.interfaces.nsILoginManager);
|
||||
pwmgr.removeAllLogins();
|
||||
},
|
||||
|
||||
get canClear()
|
||||
{
|
||||
var pwmgr = Components.classes["@mozilla.org/passwordmanager;1"]
|
||||
.getService(Components.interfaces.nsIPasswordManager);
|
||||
return pwmgr.enumerator.hasMoreElements();
|
||||
var pwmgr = Components.classes["@mozilla.org/login-manager;1"]
|
||||
.getService(Components.interfaces.nsILoginManager);
|
||||
var logins = pwmgr.getAllLogins({});
|
||||
return (logins.length > 0);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче