Back to Content

PushMessageData: blob() method

files/en-us/web/api/pushmessagedata/blob/index.md

latest529 B
Original Source

{{APIRef("Push API")}}{{SecureContext_Header}}{{AvailableInWorkers("service")}}

The blob() method of the {{domxref("PushMessageData")}} interface extracts push message data as a {{domxref("Blob")}} object.

Syntax

js-nolint
blob()

Parameters

None.

Return value

A {{domxref("Blob")}}.

Examples

js
self.addEventListener("push", (event) => {
  const blob = event.data.blob();

  // do something with your Blob
});

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}