nsISupports
Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)For example, if you wish to provide operating system integration with a native password manager system, implementing and registering a storage module for the Login Manager is how you do it. See Creating a Login Manager storage module for details.
nsILoginManager interface instead. The Login Manager will handle selecting and using the correct nsILoginManangerStorage module.void addLogin(in nsILoginInfo aLogin); |
unsigned long countLogins(in AString aHostname, in AString aActionURL, in AString aHttpRealm); |
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 getAllEncryptedLogins([optional] out unsigned long count, [retval, array, size_is(count)] out nsILoginInfo logins); |
void getAllLogins([optional] out unsigned long count, [retval, array, size_is(count)] out nsILoginInfo logins); |
boolean getLoginSavingEnabled(in AString aHost); |
void init(); |
void initWithFile(in nsIFile aInputFile, in nsIFile aOutputFile); |
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); |
| Attribute | Type | Description |
uiBusy | boolean | true when a master password prompt is being shown. Read only. |
Called by the Login Manager to store a new login.
nsILoginMetaInfo properties are created if the specified login doesn't explicitly specify them.void addLogin( in nsILoginInfo aLogin );
aLoginImplement this method to return the number of logins matching the specified criteria. This method is called, for example, to check to see if there is a login that will match the criteria without having to ask the user for their master password in order to decrypt the logins.
unsigned long countLogins( in AString aHostname, in AString aActionURL, in AString aHttpRealm );
aHostnamenull should not match any logins, and should return 0.aActionURLnull.aHttpRealmnull.The number of logins that match the specified criteria.
Implement this method to search the login store for logins matching the specified criteria. This method is called by the Login Manager when looking for saved logins that might apply to a 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 );
countaHostnamenull should not match any logins, and should return a count of 0.aActionURLnull.aHttpRealmnull.loginsnsILoginInfo matching the search criteria.Implement this method to return a list of all hosts for which password saving is disabled.
void getAllDisabledHosts(
out unsigned long count, Optional
[retval, array, size_is(count)] out wstring hostnames
);
count Optionalhostnames parameter.hostnamesFetch all logins in the login manager. An array is always returned; if there are no logins the array is empty. This does not decrypt logins before returning the array.
void getAllEncryptedLogins(
out unsigned long count, Optional
[retval, array, size_is(count)] out nsILoginInfo logins
);
count OptionalloginsnsILoginInfo objects.Implement this method to return a list of all logins in the login store.
void getAllLogins(
out unsigned long count, Optional
[retval, array, size_is(count)] out nsILoginInfo logins
);
count Optionallogins array.loginsnsILoginInfo objects in the login store. This parameter must always be an array; if there are no logins in the login store, it must be an empty array, not null.Implement to report whether or not login saving has been disabled for a specific host.
boolean getLoginSavingEnabled( in AString aHost );
aHostReturn true if login saving is enabled for the specified host; otherwise, return false.
Implement this method to initialize the component. This is not called automatically; you must call it yourself if needed.
void init();
None.
Implement this method to initialize the component, overriding the default filename locations with those specified. This method is primarily used for unit tests and during profile migration.
void initWithFile( in nsIFile aInputFile, in nsIFile aOutputFile );
aInputFileaOutputFilenull. If this is null, use the default output file.Implement this method to modify an existing login in the login store.
If newLoginData is specified as an nsILoginInfo object, all of the old login's properties are changed to the values from the newLoginData parameter. If newLoginData is a nsIPropertyBag, only the properties specified in the nsIPropertyBag are changed in oldLogin and its corresponding nsILoginMetaInfo.
void modifyLogin( in nsILoginInfo oldLogin, in nsISupports newLoginData );
oldLoginnewLoginDataoldLogin with. This may be specified as either an nsILoginInfo or an nsIPropertyBag2 object.Implement this method to remove all logins from the login store. This is called by the browser sanitization feature when the user asks to clear all stored passwords. The user interface allows this to be done without getting each login first (which might require knowing the master password). No password should be required in order to remove all logins.
void removeAllLogins();
None.
Implement this method to remove the specified login from the login store.
nsILoginMetaInfo properties are ignored.void removeLogin( in nsILoginInfo aLogin );
aLoginnsILoginMetaInfo data) to be removed.Implement this to search for logins in the login manager's data store, returning an array of matching logins. If there are no matching logins, return an empty array.
void searchLogins( out unsigned long count, in nsIPropertyBag matchData, [retval, array, size_is(count)] out nsILoginInfo logins );
countmatchDatafindLogins() for those fields; wildcard matches are not specified.loginsnsILoginInfo objects.Implement this method to enable or disable login saving for the specified host. When login saving is disabled for a host, the Login Manager will not propt the user for permission to store logins for that host. Existing logins for the host should not be affected when setting this.
void setLoginSavingEnabled( in AString aHost, in boolean isEnabled );
aHostisEnabledtrue if logins should be enabled for the host, or false if they should be disabled.For methods returning count, JavaScript callers can simply use the length property on the returned array to find out how many logins were returned in the array, for example:
var logins = pwmgr.searchLogins({}, matchData);
var numLogins = logins.length;