Skip to content

Commit

Permalink
Update files/en-us/mozilla/firefox/releases/132/index.md
Browse files Browse the repository at this point in the history
Co-authored-by: Vadim Makeev <hi@pepelsbey.dev>
  • Loading branch information
chrisdavidmills and pepelsbey authored Oct 9, 2024
1 parent ab8aadd commit 35e3562
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions files/en-us/mozilla/firefox/releases/132/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ These features are newly shipped in Firefox 132 but are disabled by default. To

The global {{domxref('Window.fetch','fetch()')}} method has a [`keepalive`](/en-US/docs/Web/API/RequestInit#keepalive) initialization option. When `keepalive` is set to `true`, the browser will not abort the associated request if the page that initiated it is unloaded before the request is complete.

This enables a fetch request to function as an alternative to {{domxref("Navigator.sendBeacon()")}} when sending analytics at the end of a session, which has some advantages (you can use HTTP methods other than [`POST`](/en-US/docs/Web/HTTP/Methods/POST), customize request properties, and access the server response via the fetch {{jsxref("Promise")}} fulfillment). It is also available in [service workers](/en-US/docs/Web/API/Service_Worker_API).
`keepalive` is enabled by default on nightly and early beta builds. ([Firefox bug 1906952](https://bugzil.la/1906952)).
This enables a fetch request to function as an alternative to {{domxref("Navigator.sendBeacon()")}} when sending analytics at the end of a session, which has some advantages (you can use HTTP methods other than [`POST`](/en-US/docs/Web/HTTP/Methods/POST), customize request properties, and access the server response via the fetch {{jsxref("Promise")}} fulfillment). It is also available in [service workers](/en-US/docs/Web/API/Service_Worker_API). ([Firefox bug 1906952](https://bugzil.la/1906952)).

- **`Promise.try()`**: <code>javascript.options.experimental.promise_try</code>. {{jsxref("Promise.try()")}} is a convenience method that takes a callback of any kind (returns or throws, synchronously or asynchronously) and wraps its result in a {{jsxref("Promise")}} so that promise semantics (e.g. {{jsxref("Promise.then", ".then()")}}, {{jsxref("Promise.catch", ".catch()")}}) can be used to handle it ([Firefox bug 1905364](https://bugzil.la/1905364)).

Expand Down

0 comments on commit 35e3562

Please sign in to comment.