From 44d38d55fbd766ea27bbaaf2d8f2f893843bde2a Mon Sep 17 00:00:00 2001 From: Chris Mills Date: Mon, 14 Jul 2025 15:58:59 +0100 Subject: [PATCH 1/4] Add speculationrules request.destination --- files/en-us/web/api/request/destination/index.md | 4 +++- .../web/http/reference/headers/speculation-rules/index.md | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/files/en-us/web/api/request/destination/index.md b/files/en-us/web/api/request/destination/index.md index 5f435863f3397f8..fa1977976997264 100644 --- a/files/en-us/web/api/request/destination/index.md +++ b/files/en-us/web/api/request/destination/index.md @@ -16,7 +16,7 @@ The string must be one of the `audio`, `audioworklet`, `document`, `embed`, `fencedframe`, `font`, `frame`, `iframe`, `image`, `json`, `manifest`, `object`, `paintworklet`, `report`, `script`, `sharedworker`, -`style`, `track`, `video`, `worker` +`speculationrules`, `style`, `track`, `video`, `worker` or `xslt` strings, or the empty string, which is the default value. The `destination` is used by the {{Glossary("user agent")}} to, for example, @@ -79,6 +79,8 @@ Possible values are: - : The target is a service worker. - `"sharedworker"` - : The target is a shared worker. +- `"speculationrules"` + - : The target is a [speculation rules](/en-US/docs/Web/API/Speculation_Rules_API) JSON document. - `"style"` - : The target is a style - `"track"` diff --git a/files/en-us/web/http/reference/headers/speculation-rules/index.md b/files/en-us/web/http/reference/headers/speculation-rules/index.md index 1ca673436b5f0df..2cfb583176eadff 100644 --- a/files/en-us/web/http/reference/headers/speculation-rules/index.md +++ b/files/en-us/web/http/reference/headers/speculation-rules/index.md @@ -13,7 +13,7 @@ sidebar: http The HTTP **`Speculation-Rules`** {{Glossary("response header")}} provides one or more URLs pointing to text resources containing speculation rule JSON definitions. When the response is an HTML document, these rules will be added to the document's speculation rule set. See the [Speculation Rules API](/en-US/docs/Web/API/Speculation_Rules_API) for more information. -The resource file containing the speculation rules JSON can have any valid name and extension, but it must be served with an `application/speculationrules+json` MIME type. +The resource file containing the speculation rules JSON can have any valid name and extension, but it with be requested with a destination type of [`speculationrules`](/en-US/docs/Web/API/Request/destination#speculationrules), and must be served with an `application/speculationrules+json` MIME type. > [!NOTE] > This mechanism provides an alternative to specifying the JSON definition inside an inline [`