Interface nsIPushServiceType

A service for components to subscribe and receive push messages from web services. This functionality is exposed to content via the Push DOM API, which uses service workers. This interface exists to support the DOM API, and allows privileged code to receive messages without migrating to service workers.

Hierarchy

Properties

pushTopic: string

Observer topic names, exported for convenience.

subscriptionChangeTopic: string
subscriptionModifiedTopic: string

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

  • Drops every subscription for the given |domain|, or all domains if |domain| is "*".

    Parameters

    • domain: string
    • callback: nsIPushClearResultCallback

    Returns void

  • Retrieves the subscription record associated with the given |(scope, principal)| pair. If the subscription does not exist, the callback will receive |null| as the second argument.

    Parameters

    • scope: string
    • principal: nsIPrincipal
    • callback: nsIPushSubscriptionCallback

    Returns void

  • Creates a push subscription for the given |scope| URL and |principal|. If a subscription already exists for this |(scope, principal)| pair, the callback will receive the existing record as the second argument.

    The |endpoint| property of the subscription record is a URL string that can be used to send push messages to subscribers.

    Each incoming message fires a push-message observer notification, with an nsIPushMessage as the subject and the |scope| as the data.

    If the server drops a subscription, a push-subscription-change observer will be fired, with the subject set to |principal| and the data set to |scope|. Servers may drop subscriptions at any time, so callers should recreate subscriptions if desired.

    Parameters

    • scope: string
    • principal: nsIPrincipal
    • callback: nsIPushSubscriptionCallback

    Returns void

  • Creates a restricted push subscription with the given public |key|. The application server must use the corresponding private key to authenticate message delivery requests, as described in draft-thomson-webpush-vapid.

    Parameters

    • scope: string
    • principal: nsIPrincipal
    • key: invalid
    • callback: nsIPushSubscriptionCallback

    Returns void

  • Removes a push subscription for the given |scope|.

    Parameters

    • scope: string
    • principal: nsIPrincipal
    • callback: nsIUnsubscribeResultCallback

    Returns void

Generated using TypeDoc