Push APIservice
The bytes() method of the PushMessageData interface extracts push message data as a Uint8Array object.
Syntax
bytes()
Parameters
None.
Return value
A Uint8Array.
Exceptions
The returned Uint8Array is backed by an ArrayBuffer of bytes. Exceptions thrown during creation of this backing buffer are re-thrown.
See TypedArray.
Examples
self.addEventListener("push", (event) => {
const buffer = event.data.bytes();
// do something with your typed array
});
Specifications
Browser compatibility
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
