PushMessageData.arrayBuffer()

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The arrayBuffer() method of the PushMessageData interface extracts push message data as an ArrayBuffer object.

Syntax

var myArrayBuffer = PushEvent.data.arrayBuffer();

Parameters

None.

Returns

An ArrayBuffer.

Examples

self.addEventListener('push', function(event) {
  var buffer = event.data.arrayBuffer();

  // do something with your array buffer
});

Specifications

Specification
Push API
# dom-pushmessagedata-arraybuffer

Browser compatibility

BCD tables only load in the browser