Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ff128 Blob.bytes() supported #34310

Merged
merged 4 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions files/en-us/mozilla/firefox/releases/128/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ This article provides information about the changes in Firefox 128 that affect d
### APIs

- {{domxref('RTCRtpReceiver.getParameters()')}} and {{domxref('RTCRtpSender.getParameters()')}} are now supported, returning an object that describes the current codecs used for the encoding and transmission of media on the receiver and sender tracks, respectively. ([Firefox bug 1534687](https://bugzil.la/1534687)).
- {{domxref('Blob.bytes()')}} is supported for returning the data from a {{domxref('Blob')}} as an array of bytes in a {{domxref("Uint8Array")}} object. ([Firefox bug 1896509](https://bugzil.la/1896509)).

#### DOM

Expand Down
39 changes: 39 additions & 0 deletions files/en-us/web/api/blob/bytes/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: "Blob: bytes() method"
short-title: bytes()
slug: Web/API/Blob/bytes
page-type: web-api-instance-method
browser-compat: api.Blob.bytes
---

{{APIRef("File API")}}{{AvailableInWorkers}}

The **`bytes()`** method of the {{domxref("Blob")}} interface returns a {{jsxref("Promise")}} that resolves with a {{domxref("Uint8Array")}} containing the contents of the blob as an array of bytes.

## Syntax

```js-nolint
bytes()
```

### Parameters

None.

### Return value

A {{jsxref("Promise")}} that fulfills with a {{domxref("Uint8Array")}} object containing the blob data.

### Exceptions

The method will reject the returned {{jsxref("Promise")}} if, for example, the reader used to fetch the blob's data throws an exception.

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also
2 changes: 2 additions & 0 deletions files/en-us/web/api/blob/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ The APIs accepting `Blob` objects are also listed in the {{DOMxRef("File")}} doc

- {{DOMxRef("Blob.arrayBuffer()")}}
- : Returns a promise that resolves with an {{jsxref("ArrayBuffer")}} containing the entire contents of the `Blob` as binary data.
- {{DOMxRef("Blob.bytes()")}}
- : Returns a promise that resolves with an {{jsxref("Uint8Array")}} containing the contents of the `Blob`.
- {{DOMxRef("Blob.slice()")}}
- : Returns a new `Blob` object containing the data in the specified range of bytes of the blob on which it's called.
- {{DOMxRef("Blob.stream()")}}
Expand Down