Interface nsILoginManagerStorageType

NOTE: This interface is intended to be implemented by modules providing storage mechanisms for the login manager. Other code should use the login manager's interfaces (nsILoginManager), and should not call storage modules directly.

Hierarchy

Properties

isLoggedIn: boolean

True when the primary password has already been entered, and so a caller can ask for decrypted logins without triggering a prompt.

uiBusy: boolean

True when a primary password prompt is being shown.

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

  • Store a new login in the storage module.

    Returns

    a clone of the login info with the guid set (even if it was not provided).

    Default values for the login's nsILoginMetaInfo properties will be created. However, if the caller specifies non-default values, they will be used instead.

    Parameters

    • aLogin: nsILoginInfo

      The login to be added.

    • aPreEncrypted: boolean

      Whether the login was already encrypted or not.

    • aPlaintextUsername: any

      The plaintext username, if the login was already encrypted.

    • aPlaintextPassword: any

      The plaintext password, if the login was already encrypted.

    Returns nsILoginInfo

  • Search for logins matching the specified criteria, as with findLogins(). This interface only returns the number of matching logins (and not the logins themselves), which allows a caller to check for logins without causing the user to be prompted for a primary password to decrypt the logins.

    Parameters

    • aOrigin: string

      The origin to restrict searches to. Specify an empty string to match all origins. A null value will not match any logins, and will thus always return a count of 0.

    • aActionOrigin: string

      The origin to which a form login will be submitted. To match any form login, specify an empty string. To not match any form login, specify null.

    • aHttpRealm: string

      The HTTP Realm for which the login applies. To match logins for any realm, specify an empty string. To not match logins for any realm, specify null.

    Returns number

  • Fetch all logins in the login manager. An array is always returned; if there are no logins the array is empty.

    Returns

    An array of nsILoginInfo objects.

    Returns any

  • Returns the timestamp of the last sync as a double (in seconds since Epoch rounded to two decimal places), or 0.0 if the data doesn't exist.

    Returns any

  • Returns the "sync id" used by Sync to know whether the store is current with respect to the sync servers.

    Returns null if the data doesn't exist or if the data can't be decrypted (including if the primary-password prompt is cancelled). This is OK for Sync as it can't even begin syncing if the primary-password is locked as the sync encrytion keys are stored in this login manager.

    Returns any

  • Initialize the component.

    At present, other methods of this interface may be called before the returned promise is resolved or rejected.

    Returns

    Resolves

    When initialization is complete.

    Rejects

    JavaScript exception.

    Returns any

  • Modify an existing login in the storage module.

    Parameters

    • oldLogin: nsILoginInfo

      The login to be modified.

    • newLoginData: nsISupports

      The new login values (either a nsILoginInfo or nsIProperyBag)

      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.

    Returns void

  • Record that the password of a saved login was used (e.g. submitted or copied).

    Parameters

    • aLogin: nsILoginInfo

    Returns void

  • Completely remove all logins, including the user's FxA key.

    Returns void

  • Remove all stored user facing logins.

    This will remove all the logins that a user can access through about:logins. This will not remove the FxA Sync key which is stored with the rest of a user's logins but is not accessible through about:logins

    The browser sanitization feature allows the user to clear any stored passwords. This interface allows that to be done without getting each login first.

    Returns void

  • Remove a login from the storage module.

    Parameters

    • aLogin: nsILoginInfo

      The login to be removed.

      The specified login must exactly match a stored login. However, the values of any nsILoginMetaInfo properties are ignored.

    Returns void

  • Asynchonously search for logins in the login manager. The Promise always resolves to an array; if there are no logins the array is empty.

    Returns

    A promise resolving to an array of nsILoginInfo objects.

    Parameters

    • matchData: any

      The data used to search as a JS object. This does not follow the same requirements as findLogins for those fields. Wildcard matches are simply not specified.

    Returns any

  • Sets the timestamp of the last sync.

    Parameters

    • timestamp: number

    Returns any

  • Sets the "sync id" used by Sync to know whether the store is current with respect to the sync servers. May be set to null.

    Throws if the data can't be encrypted (including if the primary-password prompt is cancelled)

    Parameters

    • syncID: string

    Returns any

  • Ensures that all data has been written to disk and all files are closed.

    At present, this method is called by regression tests only. Finalization on shutdown is done by observers within the component.

    Returns

    Resolves

    When finalization is complete.

    Rejects

    JavaScript exception.

    Returns any

Generated using TypeDoc