-
Notifications
You must be signed in to change notification settings - Fork 22.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add rel notes for Fx132 fetch() keepalive support, and tweak docs (#3…
…6236) * Add rel notes for Fx132 fetch() keepalive support, and tweak docs * change KB back to kibibytes * Update files/en-us/mozilla/firefox/releases/132/index.md Co-authored-by: Vadim Makeev <[email protected]> --------- Co-authored-by: Vadim Makeev <[email protected]>
- Loading branch information
1 parent
11135cd
commit 7a2d87c
Showing
5 changed files
with
96 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
title: "Request: keepalive property" | ||
short-title: keepalive | ||
slug: Web/API/Request/keepalive | ||
page-type: web-api-instance-property | ||
browser-compat: api.Request.keepalive | ||
--- | ||
|
||
{{APIRef("Fetch API")}} | ||
|
||
The **`keepalive`** read-only property of the {{domxref("Request")}} interface contains the request's `keepalive` setting (`true` or `false`), which indicates whether the browser will keep the associated request alive if the page that initiated it is unloaded before the request is complete. | ||
|
||
This enables a {{domxref('Window.fetch','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). | ||
|
||
## Value | ||
|
||
A boolean value indicating the `keepalive` status of the request. | ||
|
||
## Examples | ||
|
||
In the following snippet, we create a new request using the {{domxref("Request.Request", "Request()")}} constructor with `keepalive` set to `true`, then save the `keepalive` value of the request in a variable: | ||
|
||
```js | ||
const options = { | ||
keepalive: true, | ||
}; | ||
|
||
const myRequest = new Request("flowers.jpg", options); | ||
let mykeepalive = myRequest.keepalive; // true | ||
``` | ||
|
||
## Specifications | ||
|
||
{{Specifications}} | ||
|
||
## Browser compatibility | ||
|
||
{{Compat}} | ||
|
||
## See also | ||
|
||
- [ServiceWorker API](/en-US/docs/Web/API/Service_Worker_API) | ||
- [HTTP access control (CORS)](/en-US/docs/Web/HTTP/CORS) | ||
- [HTTP](/en-US/docs/Web/HTTP) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters