Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

nsIPushMessage

A push message sent to a system subscription.
Inherits from: nsISupports Last changed in Gecko 46.0 (Firefox 46.0 / Thunderbird 46.0 / SeaMonkey 2.43)

nsIPushMessage is the subject of a push-message observer notification.

This interface resembles PushMessageData from the Push API.

Method overview

DOMString text();
jsval json();
void binary([optional] out uint32_t dataLen, [array, retval, size_is(dataLen)] out uint8_t data);

Methods

text()

Extracts the message data as a UTF-8 text string.

DOMString text();

Parameters

None.

json()

Parses the message data as JSON.

jsval json();

Parameters

None.

binary()

Extracts the message data as a byte array.

void binary(
  [optional] out uint32_t dataLen,
  [array, retval, size_is(dataLen)] out uint8_t data
);

Parameters

dataLen
The data size.
data
The byte array containing the data.

dataLen and data are out parameters. When called from JavaScript, nsIPushMessage.binary() returns data. Please see "Method parameters" in XPIDL for more details on using out parameters in JavaScript.

See also

Document Tags and Contributors

 Contributors to this page: rolfedh, kitcambridge
 Last updated by: rolfedh,