Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2023.
* Some parts of this feature may have varying levels of support.
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
Note: This feature is only available in Service Workers.
The PushMessageData interface of the Push API provides methods which let you retrieve the push data sent by a server in various formats.
Unlike the similar methods in the Fetch API, which only allow the method to be invoked once, these methods can be called multiple times.
Messages received through the Push API are sent encrypted by push services and then automatically decrypted by browsers before they are made accessible through the methods of the PushMessageData interface.
None.
Extracts the data as an ArrayBuffer object.
PushMessageData.blob()Extracts the data as a Blob object.
PushMessageData.bytes()Extracts the data as a Uint8Array object.
PushMessageData.json()Extracts the data as a JSON object.
PushMessageData.text()Extracts the data as a plain text string.
| Push API # pushmessagedata-interface |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Jul 13, 2024 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.