Interface nsILoginManagerType

Hierarchy

Properties

initializationPromise: any

This promise is resolved when initialization is complete, and is rejected in case initialization failed. This includes the initial loading of the login data as well as any migration from previous versions.

Calling any method of nsILoginManager before this promise is resolved might trigger the synchronous initialization fallback.

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 displayed.

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 login manager.

    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.

    Returns nsILoginInfo

  • Like addLogin, but asynchronous and for many logins.

    Returns

    A promise which resolves with a JS Array of cloned logins with the guids set.

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

    Parameters

    • aLogins: any

      A JS Array of nsILoginInfos to add.

    Returns any

  • 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

  • Ensures that the local sync ID for the engine matches the sync ID for the collection on the server. If they don't match, then we set the local sync ID to newSyncID and reset the last sync timestamp.

    Parameters

    • newSyncID: string

    Returns any

  • Like getAllLogins, but asynchronous. This method is faster when large amounts of logins are present since it will handle decryption in one batch.

    Returns

    A promise which resolves with a JS Array of nsILoginInfo objects.

    Returns any

  • Like getAllLoginsAsync, but with a callback returning the search results.

    Parameters

    • aCallback: nsILoginSearchCallback

      The interface to notify when the search is complete.

    Returns void

  • 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

  • Check to see if saving logins has been disabled for an origin.

    Parameters

    Returns boolean

  • 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

  • Modify an existing login in the login manager.

    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

      The login record of the password that was used.

    • aPrivateContextWithoutExplicitConsent: boolean

      If the use was in private browsing AND without the user explicitly choosing to save/update. Login use metadata will not be updated in this case but it will stil be counted for telemetry.

    • aLoginType: string

      One of "form_login", "form_password", "auth_login", or "prompt_login". See saved_login_used in Events.yaml. Don't assume that an auth. login is never used in a form and vice-versa. This argument indicates the context of how it was used.

    • aFilled: boolean

      Whether the login was filled, rather than being typed manually.

      If only the username was used, this method shouldn't be called as we don't want to double-count the use if both the username and password are copied. Copying of the username normally precedes the copying of the password anyways.

    Returns void

  • Completely remove all logins, including the user's FxA Sync 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 login manager.

    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. If a guid is specified then no other properties are used (outside of GeckoView).

    Returns any

  • Sets the timestamp of the last sync.

    Parameters

    • timestamp: number

    Returns any

  • Disable (or enable) storing logins for the specified origin. When disabled, the login manager will not prompt to store logins for that origin. Existing logins are not affected.

    Parameters

    • aHost: string

      The origin to set. For example: "http://foo.com".

    • isEnabled: boolean

      Specify if saving logins should be enabled (true) or disabled (false)

    Returns void

  • 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

Generated using TypeDoc