Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

nsIPasswordManager

Used to interface with the built-in Password Manager
39
Introduced
Gecko 1.0
Deprecated
Gecko 1.9
Inherits from: nsISupports Last changed in Gecko 1.0

See Using nsIPasswordManager for examples.

Implemented by: @mozilla.org/passwordmanager;1. To create an instance, use:

var passwordManager = Components.classes["@mozilla.org/passwordmanager;1"]
                                .getService(Components.interfaces.nsIPasswordManager);

Method overview

void addUser(in AUTF8String aHost, in AString aUser, in AString aPassword);
void removeUser(in AUTF8String aHost, in AString aUser);
void addReject(in AUTF8String aHost);
void removeReject(in AUTF8String aHost);

Attributes

Attribute Type Description
enumerator nsISimpleEnumerator Readonly: An enumeration of the stored usernames and passwords as nsIPassword objects.
enumerator nsISimpleEnumerator Readonly: An enumeration of the rejected sites as nsIPassword objects. Only the host portion of these objects is relevant.

Methods

addUser()

Stores a password.

 AString addUser(in AUTF8String aHost,
                 in AString aUser,
                 in AString aPassword);
Parameters
aHost
The hostname of the password to store.
aUser
The username of the password to store.
aPassword
The password to store.

removeUser()

Removes a stored password.

 void removeUser(in AUTF8String aHost,
                 in AString aUser);
Parameters
aHost
The hostname of the password to remove.
aUser
The username of the password to remove.

addReject()

Blocks a hostname from having its passwords saved.

 void addReject(in AUTF8String aHost);
Parameters
aHost
The name of the hostname for which passwords should no longer be saved.

removeReject()

Unblocks a hostname from having its passwords saved.

 void removeReject(in AUTF8String aHost);
Parameters
aHost
The name of the hostname for which passwords can be saved again.

Document Tags and Contributors

 Contributors to this page: teoli, jswisher, Neil, Ted_Mielczarek, Nickolay, Zachlipton
 Last updated by: jswisher,