Interface nsIAlertNotificationType

Hierarchy

Properties

URI: nsIURI

The URI of the page that created the alert. |null| if the alert is not actionable.

actionable: boolean

Indicates whether this alert should show the source string and action buttons. False for system alerts (which can omit the principal), or expanded, system, and null principals.

cookie: string

An opaque cookie that will be passed to the alert listener for each callback.

data: string

A Base64-encoded structured clone buffer containing data associated with this alert. Only used for web notifications. Chrome callers should use a cookie instead.

dir: string

Bidi override for the title and contents. Valid values are "auto", "ltr", or "rtl". Ignored if the backend doesn't support localization.

imageURL: string

A URL identifying the image to put in the alert. The OS X backend limits the amount of time it will wait for the image to load to six seconds. After that time, the alert will show without an image.

inPrivateBrowsing: boolean

Controls the image loading behavior. If true, the image request will be loaded anonymously (without cookies or authorization tokens).

lang: string

Language of the title and text. Ignored if the backend doesn't support localization.

launchURL: string

A URL to navigate to if the application is relaunched in to complete interaction with this alert.

name: string

The name of the notification. On Windows and Android, the name is hashed and used as a notification ID. Notifications will replace previous notifications with the same name.

principal: nsIPrincipal

The principal of the page that created the alert. Used for IPC security checks, and to determine whether the alert is actionable.

requireInteraction: boolean

Indicates that the notification should remain readily available until the user activates or dismisses the notification.

silent: boolean

When set, indicates that no sounds or vibrations should be made.

source: string

The host and port of the originating page, or an empty string if the alert is not actionable.

text: string

The contents of the alert.

textClickable: boolean

Controls the click behavior. If true, the alert listener will be notified when the user clicks on the alert.

title: string

The title for the alert.

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

  • Initializes an alert notification.

    Parameters

    • aName: string
    • aImageURL: string
    • aTitle: string
    • aText: string
    • aTextClickable: boolean
    • aCookie: string
    • aDir: string
    • aLang: string
    • aData: string
    • aPrincipal: nsIPrincipal
    • aInPrivateBrowsing: boolean
    • aRequireInteraction: boolean
    • aSilent: boolean
    • aVibrate: invalid

    Returns void

  • Loads the image associated with this alert.

    Parameters

    • aTimeout: number

      The number of milliseconds to wait before cancelling the image request. If zero, there is no timeout.

    • aListener: nsIAlertNotificationImageListener

      An |nsIAlertNotificationImageListener| implementation, notified when the image loads. The listener is kept alive until the request completes.

    • aUserData: nsISupports

      An opaque parameter passed to the listener's methods. Not used by the libnotify backend, but the OS X backend passes the pending notification.

    Returns nsICancelable

Generated using TypeDoc