nsISupports
Last changed in Gecko 1.9.2 (Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0)Replaces nsIPasswordManager
which was used in older versions of Gecko.
Implemented by: @mozilla.org/login-manager;1
. To create an instance, use:
var loginManager = Components.classes["@mozilla.org/login-manager;1"] .getService(Components.interfaces.nsILoginManager);
void addLogin(in nsILoginInfo aLogin); |
nsIAutoCompleteResult autoCompleteSearch(in AString aSearchString, in nsIAutoCompleteResult aPreviousResult, in nsIDOMHTMLInputElement aElement); |
unsigned long countLogins(in AString aHostname, in AString aActionURL, in AString aHttpRealm); |
boolean fillForm(in nsIDOMHTMLFormElement aForm); |
void findLogins(out unsigned long count, in AString aHostname, in AString aActionURL, in AString aHttpRealm, [retval, array, size_is(count)] out nsILoginInfo logins); |
void getAllDisabledHosts([optional] out unsigned long count, [retval, array, size_is(count)] out wstring hostnames); |
void getAllLogins([optional] out unsigned long count, [retval, array, size_is(count)] out nsILoginInfo logins); |
boolean getLoginSavingEnabled(in AString aHost); |
void modifyLogin(in nsILoginInfo oldLogin, in nsISupports newLoginData); |
void removeAllLogins(); |
void removeLogin(in nsILoginInfo aLogin); |
void searchLogins(out unsigned long count, in nsIPropertyBag matchData, [retval, array, size_is(count)] out nsILoginInfo logins); |
void setLoginSavingEnabled(in AString aHost, in boolean isEnabled); |
Stores a new login in the Login Manager.
nsILoginMetaInfo
properties are created if the specified login doesn't explicitly specify them.void addLogin( in nsILoginInfo aLogin );
aLogin
modifyLogin()
.Generates results for a user field autocomplete menu.
FormFillController
, which calls it directly. It should not be used for any other purpose.nsIAutoCompleteResult autoCompleteSearch( in AString aSearchString, in nsIAutoCompleteResult aPreviousResult, in nsIDOMHTMLInputElement aElement );
aSearchString
aPreviousResult
aElement
Missing Description
Returns the number of logins matching the specified criteria. Called when only the number of logins is needed, and not the actual logins (which avoids prompting the user for a Master Password, as the logins don't need to be decrypted).
unsigned long countLogins( in AString aHostname, in AString aActionURL, in AString aHttpRealm );
aHostname
""
(empty string). A value of null
will cause countLogins() to not match any logins.aActionURL
""
(empty string). To not match any form logins (For example when interested in protocol logins only), specify null
.aHttpRealm
""
(empty string). To not match any protocol logins (For example when interested in form logins only), specify null
.The number of logins matching the parameters passed.
Fills out a form with login information, if appropriate information is available.
signon.autofillForms
preference.boolean fillForm( in nsIDOMHTMLFormElement aForm );
aForm
true
if the form was successfully filled out; otherwise false
.
Searches for logins matching the specified criteria. Called when looking for logins that might be applicable to a given form or authentication request.
void findLogins( out unsigned long count, in AString aHostname, in AString aActionURL, in AString aHttpRealm, [retval, array, size_is(count)] out nsILoginInfo logins );
count
length
property and supply a dummy argument for this parameter.aHostname
aActionURL
null
. An empty string ("") will match any value (except null
).aHttpRealm
null
. An empty string ("") will match any value (except null
).logins
nsILoginInfo
objects.This method can be called from JavaScript like this:
var logins = myLoginMgr.findLogins({}, 'https://bugzilla.mozilla.org', '', '', {});
Returns a list of all hosts for which login saving is disabled.
void getAllDisabledHosts( [optional] out unsigned long count, [retval, array, size_is(count)] out wstring hostnames );
count
length
property and supply a dummy argument for this parameter.hostnames
You can call this method from JavaScript like this:
var disabledHosts = myLoginMgr.getAllDisabledHosts({});
Returns an array containing all logins recorded by the Login Manager.
If you just want to see if any logins are stored, use countLogins()
instead. It's more efficient, and avoids the possibility of the user being prompted for their master password.
void getAllLogins( [optional] out unsigned long count, [retval, array, size_is(count)] out nsILoginInfo logins );
count
length
property and supply a dummy argument for this parameter.logins
nsILoginInfo
objects containing all the logins the Login Manager has on record.You can call this method from JavaScript like this:
var logins = myLoginMgr.getAllLogins({});
Reports whether or not saving login information is enabled for a host.
boolean getLoginSavingEnabled( in AString aHost );
aHost
true
if login saving is enabled for the host, otherwise false
.
Modifies an existing login by replacing it with a new one.
If newLoginData is a nsILoginInfo
, all of the old login's nsILoginInfo
properties are changed to the values from newLoginData (but the old login's nsILoginMetaInfo
properties are unmodified).
If newLoginData is a nsIPropertyBag
, only the specified properties will be changed. The nsILoginMetaInfo
properties of oldLogin can be changed in this manner.
If the propertybag contains an item named "timesUsedIncrement", the login's timesUsed property will be incremented by the item's value.
void modifyLogin( in nsILoginInfo oldLogin, in nsISupports newLoginData );
oldLogin
newLoginData
oldLogin
with. This may be specified as either an nsILoginInfo
or an nsIPropertyBag2
object.Removes all logins known by the Login Manager. This works without a need for the master password, if one is set.
void removeAllLogins();
None.
Removes a login from the Login Manager.
nsILoginMetaInfo
properties are ignored.void removeLogin( in nsILoginInfo aLogin );
aLogin
Searches for logins in the login manager's data store, returning an array of matching logins. If there are no matching logins, an empty array is returned.
void searchLogins( out unsigned long count, in nsIPropertyBag matchData, [retval, array, size_is(count)] out nsILoginInfo logins );
count
matchData
findLogins()
for those fields; wildcard matches are not specified.logins
nsILoginInfo
objects.This method can be called from JavaScript like this:
var logins = myLoginMgr.searchLogins({}, matchData); var numLogins = logins.length;
Enables or disables storing logins for a specified host. When login storing is disabled, the Login Manager won't prompt the user to store logins for that host. Existing logins are not affected.
void setLoginSavingEnabled( in AString aHost, in boolean isEnabled );
aHost
isEnabled
true
, login saving is enabled for the specified host. If false
, login saving is disabled.