From d36cd679498a75dccf51685d8e178994a0df585e Mon Sep 17 00:00:00 2001 From: "Queen Vinyl Da.i'gyu-Kazotetsu" <vinyldarkscratch@gmail.com> Date: Tue, 2 Jul 2024 10:13:09 -0700 Subject: [PATCH 1/4] Remove -moz-page CSS selectors (#34554) --- files/en-us/_redirects.txt | 3 -- files/en-us/_wikihistory.json | 36 ------------------- .../en-us/mozilla/firefox/releases/7/index.md | 2 +- .../_doublecolon_-moz-page-sequence/index.md | 33 ----------------- .../web/css/_doublecolon_-moz-page/index.md | 33 ----------------- .../index.md | 33 ----------------- .../en-us/web/css/mozilla_extensions/index.md | 3 -- 7 files changed, 1 insertion(+), 142 deletions(-) delete mode 100644 files/en-us/web/css/_doublecolon_-moz-page-sequence/index.md delete mode 100644 files/en-us/web/css/_doublecolon_-moz-page/index.md delete mode 100644 files/en-us/web/css/_doublecolon_-moz-scrolled-page-sequence/index.md diff --git a/files/en-us/_redirects.txt b/files/en-us/_redirects.txt index 1290a17846134f9..3796f9a57a886d1 100644 --- a/files/en-us/_redirects.txt +++ b/files/en-us/_redirects.txt @@ -398,11 +398,8 @@ /en-US/docs/CSS/:-moz-ui-valid /en-US/docs/Web/CSS/:user-valid /en-US/docs/CSS/:-moz-user-disabled /en-US/docs/Web/CSS/:-moz-user-disabled /en-US/docs/CSS/:-moz-window-inactive /en-US/docs/Web/CSS/:-moz-window-inactive -/en-US/docs/CSS/::-moz-page /en-US/docs/Web/CSS/::-moz-page -/en-US/docs/CSS/::-moz-page-sequence /en-US/docs/Web/CSS/::-moz-page-sequence /en-US/docs/CSS/::-moz-placeholder /en-US/docs/Web/CSS/::placeholder /en-US/docs/CSS/::-moz-progress-bar /en-US/docs/Web/CSS/::-moz-progress-bar -/en-US/docs/CSS/::-moz-scrolled-page-sequence /en-US/docs/Web/CSS/::-moz-scrolled-page-sequence /en-US/docs/CSS/::-moz-selection /en-US/docs/Web/CSS/::selection /en-US/docs/CSS/::after /en-US/docs/Web/CSS/::after /en-US/docs/CSS/::after-redirect-1 /en-US/docs/Web/CSS/::after diff --git a/files/en-us/_wikihistory.json b/files/en-us/_wikihistory.json index e7d8dd188847152..1e904f08c5cdf71 100644 --- a/files/en-us/_wikihistory.json +++ b/files/en-us/_wikihistory.json @@ -73357,30 +73357,6 @@ "Sheppy" ] }, - "Web/CSS/::-moz-page": { - "modified": "2020-10-15T21:08:00.388Z", - "contributors": [ - "wbamberg", - "ExE-Boss", - "fscholz", - "teoli", - "mfluehr", - "Sebastianz", - "Sheppy" - ] - }, - "Web/CSS/::-moz-page-sequence": { - "modified": "2020-10-15T21:07:58.857Z", - "contributors": [ - "wbamberg", - "ExE-Boss", - "fscholz", - "teoli", - "mfluehr", - "Sebastianz", - "Sheppy" - ] - }, "Web/CSS/::-moz-progress-bar": { "modified": "2020-07-29T00:12:03.398Z", "contributors": [ @@ -73431,18 +73407,6 @@ "cvrebert" ] }, - "Web/CSS/::-moz-scrolled-page-sequence": { - "modified": "2020-10-15T21:08:02.632Z", - "contributors": [ - "wbamberg", - "ExE-Boss", - "fscholz", - "teoli", - "mfluehr", - "Sebastianz", - "Sheppy" - ] - }, "Web/CSS/::-webkit-inner-spin-button": { "modified": "2020-10-15T21:42:34.532Z", "contributors": [ diff --git a/files/en-us/mozilla/firefox/releases/7/index.md b/files/en-us/mozilla/firefox/releases/7/index.md index ea58fd59798f069..f4826a69c1a48e1 100644 --- a/files/en-us/mozilla/firefox/releases/7/index.md +++ b/files/en-us/mozilla/firefox/releases/7/index.md @@ -186,7 +186,7 @@ The following interfaces were removed as part of the removal of the ActiveX embe ### Other Changes - The structure of the library window (`places.xul`) [has been cleaned up](https://bugzil.la/588027). This [may break extensions](https://bugzil.la/677417) and themes. -- The look of the print preview window [has been modernized](https://bugzil.la/663028) and theme authors are encouraged to style it using the CSS pseudo-elements {{ cssxref("::-moz-page") }}, {{ cssxref("::-moz-page-sequence") }} and {{ cssxref("::-moz-scrolled-page-sequence") }}. +- The look of the print preview window [has been modernized](https://bugzil.la/663028) and theme authors are encouraged to style it using the CSS pseudo-elements `::-moz-page`, `::-moz-page-sequence` and `::-moz-scrolled-page-sequence`. ## See also diff --git a/files/en-us/web/css/_doublecolon_-moz-page-sequence/index.md b/files/en-us/web/css/_doublecolon_-moz-page-sequence/index.md deleted file mode 100644 index 7a6cfe387408532..000000000000000 --- a/files/en-us/web/css/_doublecolon_-moz-page-sequence/index.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: "::-moz-page-sequence" -slug: Web/CSS/::-moz-page-sequence -page-type: css-pseudo-element -status: - - non-standard -browser-compat: css.selectors.-moz-page-sequence ---- - -{{CSSRef}}{{Non-standard_Header}} - -The **`::-moz-page-sequence`** [CSS](/en-US/docs/Web/CSS) [pseudo-element](/en-US/docs/Web/CSS/Pseudo-elements) is a [Mozilla extension](/en-US/docs/Web/CSS/Mozilla_Extensions) that represents the background of a print preview. - -## Syntax - -```css -::-moz-page-sequence { - /* ... */ -} -``` - -## Specifications - -Not part of any standard. - -## Browser compatibility - -{{Compat}} - -## See also - -- {{CSSxRef("::-moz-page")}} -- {{CSSxRef("::-moz-scrolled-page-sequence")}} diff --git a/files/en-us/web/css/_doublecolon_-moz-page/index.md b/files/en-us/web/css/_doublecolon_-moz-page/index.md deleted file mode 100644 index 20df4bd0c2315a4..000000000000000 --- a/files/en-us/web/css/_doublecolon_-moz-page/index.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: "::-moz-page" -slug: Web/CSS/::-moz-page -page-type: css-pseudo-element -status: - - non-standard -browser-compat: css.selectors.-moz-page ---- - -{{CSSRef}}{{Non-standard_header}} - -The **`::-moz-page`** [CSS](/en-US/docs/Web/CSS) [pseudo-element](/en-US/docs/Web/CSS/Pseudo-elements) is a [Mozilla extension](/en-US/docs/Web/CSS/Mozilla_Extensions) that represents an individual page when printed or in a print preview. - -## Syntax - -```css -::-moz-page { - /* ... */ -} -``` - -## Specifications - -Not part of any standard. - -## Browser compatibility - -{{Compat}} - -## See also - -- {{CSSxRef("::-moz-page-sequence")}} -- {{CSSxRef("::-moz-scrolled-page-sequence")}} diff --git a/files/en-us/web/css/_doublecolon_-moz-scrolled-page-sequence/index.md b/files/en-us/web/css/_doublecolon_-moz-scrolled-page-sequence/index.md deleted file mode 100644 index dfd7ac696d72955..000000000000000 --- a/files/en-us/web/css/_doublecolon_-moz-scrolled-page-sequence/index.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: "::-moz-scrolled-page-sequence" -slug: Web/CSS/::-moz-scrolled-page-sequence -page-type: css-pseudo-element -status: - - non-standard -browser-compat: css.selectors.-moz-scrolled-page-sequence ---- - -{{CSSRef}}{{non-standard_header}} - -The **`::-moz-scrolled-page-sequence`** [CSS](/en-US/docs/Web/CSS) [pseudo-element](/en-US/docs/Web/CSS/Pseudo-elements) is a [Mozilla extension](/en-US/docs/Web/CSS/Mozilla_Extensions) that represents the background of a print preview. - -## Syntax - -```css -::-moz-scrolled-page-sequence { - /* ... */ -} -``` - -## Specifications - -Not part of any standard. - -## Browser compatibility - -{{Compat}} - -## See also - -- {{CSSxRef("::-moz-page")}} -- {{CSSxRef("::-moz-page-sequence")}} diff --git a/files/en-us/web/css/mozilla_extensions/index.md b/files/en-us/web/css/mozilla_extensions/index.md index 3296166d0dd7212..e9172322a29172d 100644 --- a/files/en-us/web/css/mozilla_extensions/index.md +++ b/files/en-us/web/css/mozilla_extensions/index.md @@ -451,8 +451,6 @@ Properties: {{CSSxRef("width")}}, {{CSSxRef("min-width")}}, and {{CSSxRef("max-w - {{CSSxRef(":-moz-native-anonymous")}} - {{CSSxRef(":-moz-only-whitespace")}} -- {{CSSxRef("::-moz-page")}} -- {{CSSxRef("::-moz-page-sequence")}} - {{CSSxRef("::-moz-pagebreak")}} - {{CSSxRef("::-moz-pagecontent")}} - {{CSSxRef(":placeholder-shown", ":-moz-placeholder")}} {{deprecated_inline}} @@ -468,7 +466,6 @@ Properties: {{CSSxRef("width")}}, {{CSSxRef("min-width")}}, and {{CSSxRef("max-w - {{CSSxRef("::-moz-scrolled-canvas")}} - {{CSSxRef("::-moz-scrolled-content")}} -- {{CSSxRef("::-moz-scrolled-page-sequence")}} - {{CSSxRef("::selection","::-moz-selection")}} {{deprecated_inline}} - {{CSSxRef(":-moz-submit-invalid")}} - {{CSSxRef(":-moz-suppressed")}} From 7b33fd0009f209120a8dbae834d4e179ce667f50 Mon Sep 17 00:00:00 2001 From: rebloor <git@sherpa.co.nz> Date: Wed, 3 Jul 2024 10:15:04 +1200 Subject: [PATCH 2/4] Docs for support for execution-world MAIN (#34466) * Docs for support for execution-world MAIN * Grammar fix * `world` in the `content_scripts` manifest key * Update from review feedback --- .../api/contentscripts/register/index.md | 20 ++++++++++--------- .../api/scripting/executionworld/index.md | 5 ++--- .../manifest.json/content_scripts/index.md | 3 +-- .../mozilla/firefox/releases/128/index.md | 1 + 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/files/en-us/mozilla/add-ons/webextensions/api/contentscripts/register/index.md b/files/en-us/mozilla/add-ons/webextensions/api/contentscripts/register/index.md index 02f9b132f247a4e..785220328888e96 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/contentscripts/register/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/api/contentscripts/register/index.md @@ -9,7 +9,7 @@ browser-compat: webextensions.api.contentScripts.register Use this function to register one or more content scripts. -It accepts one parameter, which is an object with similar properties to the objects given in the [`content_scripts`](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts) manifest key (but note that `content_scripts` is an array of objects, while the argument to `register()` is a single object). +It accepts one parameter, which is an object with similar properties to the objects given in the [`content_scripts`](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts) manifest key (but note that `content_scripts` is an array of objects, while the argument to `register()` is one object). This is an asynchronous function that returns a [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). @@ -33,27 +33,29 @@ let registering = browser.contentScripts.register( The `RegisteredContentScriptOptions` object has the following properties: - `allFrames` {{optional_inline}} - - : Same as `all_frames` in the [`content_scripts`](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts) key. + - : Same as [`all_frames` in the `content_scripts`](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts#all_frames) key. - `cookieStoreId` {{optional_inline}} - : A string or array of strings. Registers the content script in the tabs that belong to one or more cookie store IDs. This enables scripts to be registered for all default or non-contextual identity tabs, private browsing tabs (if the [extension is enabled in private browsing](https://support.mozilla.org/en-US/kb/extensions-private-browsing)), the tabs of a [contextual identity](/en-US/docs/Mozilla/Add-ons/WebExtensions/Work_with_contextual_identities), or a combination of these. See [Work with contextual identities](/en-US/docs/Mozilla/Add-ons/WebExtensions/Work_with_contextual_identities) for more information. - `css` {{optional_inline}} - : An array of objects. Each object has either a property named `file`, which is a URL starting at the extension's manifest.json and pointing to a CSS file to register, or a property named `code`, which is some CSS code to register. - `excludeGlobs` {{optional_inline}} - - : Same as `exclude_globs` in the [`content_scripts`](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts) key. + - : Same as [`exclude_globs` in the `content_scripts`](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts#exclude_globs) key. - `excludeMatches` {{optional_inline}} - - : Same as `exclude_matches` in the [`content_scripts`](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts) key. + - : Same as [`exclude_matches` in the `content_scripts`](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts#exclude_matches) key. - `includeGlobs` {{optional_inline}} - - : Same as `include_globs` in the [`content_scripts`](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts) key. + - : Same as [`include_globs` in the `content_scripts`](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts#include_globs) key. - `js` {{optional_inline}} - : An array of objects. Each object has either a property named `file`, which is a URL starting at the extension's manifest.json and pointing to a JavaScript file to register, or a property named `code`, which is some JavaScript code to register. - `matchAboutBlank` {{optional_inline}} - - : Same as `match_about_blank` in the [`content_scripts`](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts#match_about_blank) key. + - : Same as [`match_about_blank` in the `content_scripts`](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts#match_about_blank) key. - `matchOriginAsFallback` {{optional_inline}} - - : Same as `match_origin_as_fallback` in the [`content_scripts`](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts#match_origin_as_fallback) key. + - : Same as [`match_origin_as_fallback` in the `content_scripts`](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts#match_origin_as_fallback) key. - `matches` - - : Same as `matches` in the [`content_scripts`](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts) key. + - : Same as [`matches` in the `content_scripts`](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts#matches) key. - `runAt` {{optional_inline}} - - : Same as `run_at` in the [`content_scripts`](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts) key. + - : Same as [`run_at` in the `content_scripts`](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts#run_at) key. + - `world` {{optional_inline}} + - : The execution environment for a script to execute in. Same as [`world` in the `content_scripts`](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts#world) key. ### Return value diff --git a/files/en-us/mozilla/add-ons/webextensions/api/scripting/executionworld/index.md b/files/en-us/mozilla/add-ons/webextensions/api/scripting/executionworld/index.md index fae0565909bc3d4..443710625c27ca6 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/scripting/executionworld/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/api/scripting/executionworld/index.md @@ -26,12 +26,11 @@ Values of this type are strings. Possible values are: > **Warning:** Due to the lack of isolation, the web page can detect and interfere with the executed code. > Do not use the `MAIN` world unless it is acceptable for web pages to read, access, or modify the logic or data that flows through the executed code. - > `MAIN` is not supported in Firefox (although it is planned, and the work to introduce it is tracked by [Bug 1736575](https://bugzil.la/1736575)). In the meantime, JavaScript code running in the isolated content script sandbox can use the Firefox "Xray vision" feature, as described in [Share objects with page scripts](/en-US/docs/Mozilla/Add-ons/WebExtensions/Sharing_objects_with_page_scripts). + +{{WebExtExamples("h2")}} ## Browser compatibility {{Compat}} -{{WebExtExamples}} - > **Note:** This API is based on Chromium's [`chrome.scripting`](https://developer.chrome.com/docs/extensions/reference/scripting/#type-ExecutionWorld) API. diff --git a/files/en-us/mozilla/add-ons/webextensions/manifest.json/content_scripts/index.md b/files/en-us/mozilla/add-ons/webextensions/manifest.json/content_scripts/index.md index 5f7bc5222599aca..4766b2e7f0aaffc 100644 --- a/files/en-us/mozilla/add-ons/webextensions/manifest.json/content_scripts/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/manifest.json/content_scripts/index.md @@ -292,7 +292,7 @@ Details of all the keys you can include are given in the table below. </tr> <tr> <td> - <a id="run_at"><code>world</code></a> + <a id="world"><code>world</code></a> </td> <td><code>String</code></td> <td> @@ -314,7 +314,6 @@ Details of all the keys you can include are given in the table below. <p> <strong>Warning:</strong> Due to the lack of isolation, the web page can detect and interfere with the executed code. Do not use the <code>MAIN</code> world unless it is acceptable for web pages to read, access, or modify the logic or data that flows through the executed code. - <code>world</code>, and therefore <code>"MAIN"</code>, is not supported in Firefox (although it is planned, and the work to introduce it is tracked by <a href="https://bugzil.la/1736575" class="external" target="_blank">Bug 1736575</a>). In the meantime, JavaScript code running in the isolated content script sandbox can use the Firefox "Xray vision" feature, as described in <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Sharing_objects_with_page_scripts">Share objects with page scripts</a>. </p> </div> </dd> diff --git a/files/en-us/mozilla/firefox/releases/128/index.md b/files/en-us/mozilla/firefox/releases/128/index.md index cb1fefd4f695d31..e5d7c81bb2bcbaa 100644 --- a/files/en-us/mozilla/firefox/releases/128/index.md +++ b/files/en-us/mozilla/firefox/releases/128/index.md @@ -77,6 +77,7 @@ This article provides information about the changes in Firefox 128 that affect d - Adds the ability to enable and disable rules in static declarative net request rulesets with {{WebExtAPIRef("declarativeNetRequest.updateStaticRules")}} and list disabled rules for a static ruleset with {{WebExtAPIRef("declarativeNetRequest.getDisabledRuleIds")}} ([Firefox bug 1810762](https://bugzil.la/1810762)) - The default value of {{WebExtAPIRef("proxy.settings")}} property `proxyDNS` is now `false` when using SOCKS4 and `true` when using SOCKS5. Previously, it defaulted to `false` for SOCKS4 and SOCKS5 ([Firefox bug 1741375](https://bugzil.la/1741375)). - The non-standard Web API events `overflow` and `underflow` have been deprecated. Use of these events should be removed from extension documents before the release of Firefox 131 ([Firefox bug 1898445](https://bugzil.la/1898445)). +- Support is now provided for scripts to run in the web page execution environment. This is provided through support for `MAIN` in {{WebExtAPIRef("scripting.executionWorld","ExecutionWorld")}} for the {{WebExtAPIRef("scripting")}} API, the addition of `world` to the {{WebExtAPIRef("contentScripts.register()")}} API, and support for `world` in the [`content_scripts`](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts) manifest key ([Firefox bug 1736575](https://bugzil.la/1736575)). - The {{WebExtAPIRef("scripting")}} API can now inject scripts and CSS into sandboxed pages with `about:blank`, `about:srcdoc`, and `data:` URLs. This was implemented for {{WebExtAPIRef("scripting.executeScript")}}, {{WebExtAPIRef("scripting.insertCSS")}}, and {{WebExtAPIRef("scripting.removeCSS")}} in [Firefox bug 1475831](https://bugzil.la/1475831) and {{WebExtAPIRef("scripting.registerContentScripts")}} and {{WebExtAPIRef("scripting.updateContentScripts")}} in [Firefox bug 1853411](https://bugzil.la/1853411) through the introduction of `matchOriginAsFallback` to {{WebExtAPIRef("scripting.RegisteredContentScript")}}. - The [manifest key `content_scripts`](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts) now supports `match_origin_as_fallback` and {{WebExtAPIRef("contentScripts.register")}} `matchOriginAsFallback`, enabling scripts to be injected into `about:`, `data:`, and `blob:` pages when the document origin is opaque due to the use of CSP or iframe sandbox ([Firefox bug 1475831](https://bugzil.la/1475831) and [Firefox bug 1896669](https://bugzil.la/1896669)). In addition, scripts registered with the `content_scripts` manifest key can now only run in `blob:` pages when `match_origin_as_fallback` is `true` ([Firefox bug 1897113](https://bugzil.la/1897113)). From b03b0971851f3dc5ba47fe44192cd7904e1a0ed7 Mon Sep 17 00:00:00 2001 From: Mahmoud Mirghani <120668290+mahmoudmerghani@users.noreply.github.com> Date: Wed, 3 Jul 2024 01:16:09 +0300 Subject: [PATCH 3/4] Fix a typo in Conclusion (#34573) --- files/en-us/learn/javascript/building_blocks/events/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/learn/javascript/building_blocks/events/index.md b/files/en-us/learn/javascript/building_blocks/events/index.md index b4c4b3be1b1f693..9733630b2cb0e4d 100644 --- a/files/en-us/learn/javascript/building_blocks/events/index.md +++ b/files/en-us/learn/javascript/building_blocks/events/index.md @@ -435,6 +435,6 @@ You don't need to understand anything about other such environments at this stag In this chapter we've learned what events are, how to listen for events, and how to respond to them. -You've seen by now that elements in a web page can be nested inside other elements. For example, in the [Preventing default behavior](#preventing_default_behavior) example, we have some text boxes, placed inside {{htmlelement("div")}} elements, which in turn are placed inside a {{htmlelement("form")}} element. When happens when an click event listener is attached to the `<form>` element, and the user clicks inside one of the text boxes? This is called _event bubbling_ and is the subject of the next chapter. +You've seen by now that elements in a web page can be nested inside other elements. For example, in the [Preventing default behavior](#preventing_default_behavior) example, we have some text boxes, placed inside {{htmlelement("div")}} elements, which in turn are placed inside a {{htmlelement("form")}} element. What happens when a click event listener is attached to the `<form>` element, and the user clicks inside one of the text boxes? This is called _event bubbling_ and is the subject of the next chapter. {{LearnSidebar}}{{PreviousMenuNext("Learn/JavaScript/Building_blocks/Return_values","Learn/JavaScript/Building_blocks/Event_bubbling", "Learn/JavaScript/Building_blocks")}} From 413ce1e7bc8b6cacd8eea9d9b1c3dc972c118f4d Mon Sep 17 00:00:00 2001 From: wbamberg <will@bootbonnet.ca> Date: Tue, 2 Jul 2024 16:49:10 -0700 Subject: [PATCH 4/4] Document request options in one place (#34437) Co-authored-by: Joshua Chen <sidachen2003@gmail.com> Co-authored-by: sideshowbarker <mike@w3.org> --- files/en-us/web/api/fetch/index.md | 101 +----- .../web/api/request/credentials/index.md | 20 +- files/en-us/web/api/request/request/index.md | 60 +--- files/en-us/web/api/requestinit/index.md | 288 ++++++++++++++++++ files/jsondata/GroupData.json | 2 +- 5 files changed, 302 insertions(+), 169 deletions(-) create mode 100644 files/en-us/web/api/requestinit/index.md diff --git a/files/en-us/web/api/fetch/index.md b/files/en-us/web/api/fetch/index.md index a65030cff161963..6192bd627a25651 100644 --- a/files/en-us/web/api/fetch/index.md +++ b/files/en-us/web/api/fetch/index.md @@ -38,106 +38,7 @@ fetch(resource, options) - `options` {{optional_inline}} - - : An object containing any custom settings you want to apply to the request. - The possible options are: - - - `attributionReporting` {{experimental_inline}} - - - : Indicates that you want the request's response to be able to register a JavaScript-based [attribution source](/en-US/docs/Web/API/Attribution_Reporting_API/Registering_sources#javascript-based_event_sources) or [attribution trigger](/en-US/docs/Web/API/Attribution_Reporting_API/Registering_triggers#javascript-based_attribution_triggers). `attributionReporting` is an object containing the following properties: - - - `eventSourceEligible` - - : A boolean. If set to `true`, the request's response is eligible to register an attribution source. If set to `false`, it isn't. - - `triggerEligible` - - : A boolean. If set to `true`, the request's response is eligible to register an attribution trigger. If set to `false`, it isn't. - - > **Note:** See the [Attribution Reporting API](/en-US/docs/Web/API/Attribution_Reporting_API) for more details. - - - `body` - - - : Any body that you want to add to your request: - this can be a {{domxref("Blob")}}, an {{jsxref("ArrayBuffer")}}, a {{jsxref("TypedArray")}}, a {{jsxref("DataView")}}, - a {{domxref("FormData")}}, a {{domxref("URLSearchParams")}}, string object or literal, - or a {{domxref("ReadableStream")}} object. This latest possibility is still experimental; check the [compatibility information](/en-US/docs/Web/API/Request#browser_compatibility) to verify you can use it. - Note that a request using the `GET` or `HEAD` method cannot have a body. - - - `browsingTopics` {{experimental_inline}} - - - : A boolean specifying that the selected topics for the current user should be sent in a {{httpheader("Sec-Browsing-Topics")}} header with the associated request. See [Using the Topics API](/en-US/docs/Web/API/Topics_API/Using) for more details. - - - `cache` - - - : A string indicating how the request will interact with the browser's [HTTP cache](/en-US/docs/Web/HTTP/Caching). The possible values, `default`, `no-store`, `reload`, `no-cache`, `force-cache`, and `only-if-cached`, are documented in the article for the {{domxref("Request/cache", "cache")}} property of the {{domxref("Request")}} object. - - - `credentials` - - - : Controls what browsers do with credentials ([cookies](/en-US/docs/Web/HTTP/Cookies), [HTTP authentication](/en-US/docs/Web/HTTP/Authentication) entries, and TLS client certificates). Must be one of the following strings: - - - `omit`: Tells browsers to exclude credentials from the request, and ignore any credentials sent back in the response (e.g., any {{HTTPHeader("Set-Cookie")}} header). - - `same-origin`: Tells browsers to include credentials with requests to same-origin URLs, and use any credentials sent back in responses from same-origin URLs. **This is the default value.** - - `include`: Tells browsers to include credentials in both same- and cross-origin requests, and always use any credentials sent back in responses. - - > **Note:** Credentials may be included in simple and "final" cross-origin requests, but should not be included in [CORS preflight requests](/en-US/docs/Web/HTTP/CORS#preflight_requests_and_credentials). - - - `headers` - - - : Any headers you want to add to your request, contained within a {{domxref("Headers")}} object or an object literal with {{jsxref("String")}} values. - Note that [some names are forbidden](/en-US/docs/Glossary/Forbidden_header_name). - - > **Note:** The [`Authorization`](/en-US/docs/Web/HTTP/Headers/Authorization) HTTP header may be added to a request, but will be removed if the request is redirected cross-origin. - - - `integrity` - - - : Contains the [subresource integrity](/en-US/docs/Web/Security/Subresource_Integrity) - value of the request (e.g., `sha256-BpfBw7ivV8q2jLiT13fxDYAe2tJllusRSZ273h2nFSE=`). - - - `keepalive` - - : The `keepalive` option can be used to allow the request to outlive the page. - Fetch with the `keepalive` flag is a replacement for the {{domxref("Navigator.sendBeacon()")}} API. - - `method` - - - : The request method, e.g., `"GET"`, `"POST"`. - The default is `"GET"`. - Note that the {{httpheader("Origin")}} header is not set on Fetch requests with a method of {{HTTPMethod("HEAD")}} or {{HTTPMethod("GET")}}. - Any string which is a case-insensitive match for one of the methods in [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110#name-overview) will be uppercased automatically. - If you want to use a custom method (like `PATCH`), you should uppercase it yourself. - - - `mode` - - : The mode you want to use for the request, e.g., `cors`, - `no-cors`, or `same-origin`. - - `priority` - - : Specifies the priority of the fetch request relative to other requests of the same type. Must be one of the following strings: - - `high` - - : A high priority fetch request relative to other requests of the same type. - - `low` - - : A low priority fetch request relative to other requests of the same type. - - `auto` - - : Automatically determine the priority of the fetch request relative to other requests of the same type (default). - - `redirect` - - - : How to handle a `redirect` response: - - - `follow` - - : Automatically follow redirects. Unless otherwise stated the redirect mode is set to `follow`. - - `error` - - : Abort with an error if a redirect occurs. - - `manual` - - : Caller intends to process the response in another context. - See [WHATWG fetch standard](https://fetch.spec.whatwg.org/#concept-request-redirect-mode) for more information. - - - `referrer` - - - : A string specifying the referrer of the request. This can be a - same-origin URL, `about:client`, or an empty string. - - - `referrerPolicy` - - : Specifies the [referrer policy](https://w3c.github.io/webappsec-referrer-policy/#referrer-policies) to use for the request. May be one of `no-referrer`, - `no-referrer-when-downgrade`, `same-origin`, - `origin`, `strict-origin`, - `origin-when-cross-origin`, - `strict-origin-when-cross-origin`, or `unsafe-url`. - - `signal` - - : An {{domxref("AbortSignal")}} object instance; allows you to communicate with a - fetch request and abort it if desired via an {{domxref("AbortController")}}. + - : A {{domxref("RequestInit")}} object containing any custom settings that you want to apply to the request. ### Return value diff --git a/files/en-us/web/api/request/credentials/index.md b/files/en-us/web/api/request/credentials/index.md index 2aba409dc600513..46e5c486f06049a 100644 --- a/files/en-us/web/api/request/credentials/index.md +++ b/files/en-us/web/api/request/credentials/index.md @@ -8,28 +8,30 @@ browser-compat: api.Request.credentials {{APIRef("Fetch API")}} -The **`credentials`** read-only property of the {{domxref("Request")}} interface indicates whether the user agent should send or receive cookies from the other domain in the case of cross-origin requests. +The **`credentials`** read-only property of the {{domxref("Request")}} interface reflects the value given to the {{domxref("Request.Request()", "Request()")}} constructor in the [`credentials`](/en-US/docs/Web/API/RequestInit#credentials) option, and determines whether or not the browser sends credentials with the request. + +Credentials are cookies, {{glossary("TLS")}} client certificates, or authentication headers containing a username and password. + +See [Including credentials](/en-US/docs/Web/API/Fetch_API/Using_Fetch#including_credentials) for more details. ## Value -A `RequestCredentials` dictionary value indicating whether the user agent should send or receive cookies from the other domain in the case of cross-origin requests. Possible values are: +A string with one of the following values: - `omit` - - : Never send or receive cookies. + - : Never send credentials in the request or include credentials in the response. - `same-origin` - - : Send user credentials (cookies, basic http auth, etc..) if the URL is on the same origin as the calling script. **This is the default value.** + - : Only send and include credentials for same-origin requests. - `include` - - : Always send user credentials (cookies, basic http auth, etc..), even for cross-origin calls. - -This is similar to XHR's [`withCredentials`](/en-US/docs/Web/API/XMLHttpRequest/withCredentials) flag, but with three available values instead of two. + - : Always include credentials, even for cross-origin requests. ## Examples In the following snippet, we create a new request using the {{domxref("Request.Request", "Request()")}} constructor (for an image file in the same directory as the script), then save the request credentials in a variable: ```js -const myRequest = new Request("flowers.jpg"); -const myCred = myRequest.credentials; // returns "same-origin" by default +const request = new Request("flowers.jpg"); +const request = request.request; // returns "same-origin" by default ``` ## Specifications diff --git a/files/en-us/web/api/request/request/index.md b/files/en-us/web/api/request/request/index.md index f4c2b5f2972a508..0206d4dfe10d555 100644 --- a/files/en-us/web/api/request/request/index.md +++ b/files/en-us/web/api/request/request/index.md @@ -36,65 +36,7 @@ new Request(input, options) - `options` {{optional_inline}} - - : An object containing any custom settings that you want to apply to the - request. The possible options are: - - - `attributionReporting` {{experimental_inline}} - - - : Indicates that you want the request's response to be able to register a JavaScript-based [attribution source](/en-US/docs/Web/API/Attribution_Reporting_API/Registering_sources#javascript-based_event_sources) or [attribution trigger](/en-US/docs/Web/API/Attribution_Reporting_API/Registering_triggers#javascript-based_attribution_triggers). `attributionReporting` is an object containing the following properties: - - - `eventSourceEligible` - - : A boolean. If set to `true`, the request's response is eligible to register an attribution source. If set to `false`, it isn't. - - `triggerEligible` - - : A boolean. If set to `true`, the request's response is eligible to register an attribution trigger. If set to `false`, it isn't. - - > **Note:** See the [Attribution Reporting API](/en-US/docs/Web/API/Attribution_Reporting_API) for more details. - - - `body` - - : Any body that you want to add to your request: this can be a - {{domxref("Blob")}}, an {{jsxref("ArrayBuffer")}}, a {{jsxref("TypedArray")}}, a {{jsxref("DataView")}}, - a {{domxref("FormData")}}, a {{domxref("URLSearchParams")}}, a string, or a {{domxref("ReadableStream")}} object. - Note that a request using the `GET` or `HEAD` method cannot have a body. - - `browsingTopics` {{experimental_inline}} - - : A boolean specifying that the selected topics for the current user should be sent in a {{httpheader("Sec-Browsing-Topics")}} header with the associated request. See [Using the Topics API](/en-US/docs/Web/API/Topics_API/Using) for more details. - - `cache` - - : The [cache mode](/en-US/docs/Web/API/Request/cache) you want to use for the request. - - `credentials` - - : The request credentials you want to use for the - request: `omit`, `same-origin`, or `include`. The - default is `same-origin`. - - `headers` - - : Any headers you want to add to your request, contained - within a {{domxref("Headers")}} object or an object literal with - {{jsxref("String")}} values. - - `integrity` - - : Contains the [subresource integrity](/en-US/docs/Web/Security/Subresource_Integrity) - value of the request (e.g., - `sha256-BpfBw7ivV8q2jLiT13fxDYAe2tJllusRSZ273h2nFSE=`). - - `keepalive` - - : A boolean that indicates whether to make a persistent connection for multiple requests/responses. - - `method` - - : The request method, e.g., `GET`, `POST`. The default is `GET`. - - `mode` - - : The mode you want to use for the request, e.g., - `cors`, `no-cors`, `same-origin`, or - `navigate`. The default is `cors`. - - `priority` - - : Specifies the priority of the fetch request relative to other requests of the same type. Must be one of the following strings: - - `high`: A high priority fetch request relative to other requests of the same type. - - `low`: A low priority fetch request relative to other requests of the same type. - - `auto`: Automatically determine the priority of the fetch request relative to other requests of the same type (default). - - `redirect` - - : The redirect mode to use: `follow`, - `error`, or `manual`. The default is `follow`. - - `referrer` - - : A string specifying - `no-referrer`, `client`, or a URL. The default is - `about:client`. - - `referrerPolicy` - - : A string that changes how the referrer header is populated during certain actions (e.g., fetching subresources, prefetching, performing navigations). - - `signal` - - : An [AbortSignal](/en-US/docs/Web/API/AbortSignal) object which can be used to communicate with/abort a request. + - : A {{domxref("RequestInit")}} object containing any custom settings that you want to apply to the request. If you construct a new `Request` from an existing `Request`, any options you set in an _options_ argument for the new request replace any corresponding options set in the original `Request`. For example: diff --git a/files/en-us/web/api/requestinit/index.md b/files/en-us/web/api/requestinit/index.md new file mode 100644 index 000000000000000..5fbddcb75295745 --- /dev/null +++ b/files/en-us/web/api/requestinit/index.md @@ -0,0 +1,288 @@ +--- +title: RequestInit +slug: Web/API/RequestInit +page-type: web-api-interface +browser-compat: api.RequestInit +spec-urls: https://fetch.spec.whatwg.org/#requestinit +--- + +{{APIRef("Fetch API")}} + +The **`RequestInit`** dictionary of the [Fetch API](/en-US/docs/Web/API/Fetch_API) represents the set of options that can be used to configure a Fetch request. + +You can pass a `RequestInit` object into the {{domxref("Request.Request()", "Request()")}} constructor, or directly into the [`fetch()`](/en-US/docs/Web/API/fetch) function call. + +You can also construct a `Request` with a `RequestInit`, and pass the `Request` to a `fetch()` call along with another `RequestInit`. If you do this, and the same option is set in both places, then the value passed directly into `fetch()` is used. + +## Instance properties + +- `attributionReporting` {{optional_inline}} {{experimental_inline}} + + - : Indicates that you want the request's response to be able to register a JavaScript-based [attribution source](/en-US/docs/Web/API/Attribution_Reporting_API/Registering_sources#javascript-based_event_sources) or [attribution trigger](/en-US/docs/Web/API/Attribution_Reporting_API/Registering_triggers#javascript-based_attribution_triggers). `attributionReporting` is an object containing the following properties: + + - `eventSourceEligible` + - : A boolean. If set to `true`, the request's response is eligible to register an attribution source. If set to `false`, it isn't. + - `triggerEligible` + - : A boolean. If set to `true`, the request's response is eligible to register an attribution trigger. If set to `false`, it isn't. + + See the [Attribution Reporting API](/en-US/docs/Web/API/Attribution_Reporting_API) for more details. + +- `body` {{optional_inline}} + + - : The request body contains content to send to the server, for example in a {{httpmethod("POST")}} or {{httpmethod("PUT")}} request. It is specified as an instance of any of the following types: + + - a string + - {{jsxref("ArrayBuffer")}} + - {{domxref("Blob")}} + - {{jsxref("DataView")}} + - {{domxref("File")}} + - {{domxref("FormData")}} + - {{jsxref("TypedArray")}} + - {{domxref("URLSearchParams")}} + + See [Setting a body](/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_a_body) for more details. + +- `browsingTopics` {{optional_inline}} {{experimental_inline}} + + - : A boolean specifying that the selected topics for the current user should be sent in a {{httpheader("Sec-Browsing-Topics")}} header with the associated request. + + See [Using the Topics API](/en-US/docs/Web/API/Topics_API/Using) for more details. + +- `cache` {{optional_inline}} + + - : The [cache mode](/en-US/docs/Web/API/Request/cache) you want to use for the request. This may be any one of the following values: + + - `default` + + - : The browser looks in its HTTP cache for a response matching the request. + + - If there is a match and it is [fresh](/en-US/docs/Web/HTTP/Caching#fresh_and_stale_based_on_age), it will be returned from the cache. + - If there is a match but it is [stale](/en-US/docs/Web/HTTP/Caching#fresh_and_stale_based_on_age), the browser will make a [conditional request](/en-US/docs/Web/HTTP/Conditional_requests) to the remote server. If the server indicates that the resource has not changed, it will be returned from the cache. Otherwise the resource will be downloaded from the server and the cache will be updated. + - If there is no match, the browser will make a normal request, and will update the cache with the downloaded resource. + + - `no-store` + - : The browser fetches the resource from the remote server without first looking in the cache, _and will not_ update the cache with the downloaded resource. + - `reload` + - : The browser fetches the resource from the remote server without first looking in the cache, _but then will_ update the cache with the downloaded resource. + - `no-cache` + + - : The browser looks in its HTTP cache for a response matching the request. + + - If there is a match, _fresh or stale,_ the browser will make a [conditional request](/en-US/docs/Web/HTTP/Conditional_requests) to the remote server. If the server indicates that the resource has not changed, it will be returned from the cache. Otherwise the resource will be downloaded from the server and the cache will be updated. + - If there is no match, the browser will make a normal request, and will update the cache with the downloaded resource. + + - `force-cache` + + - : The browser looks in its HTTP cache for a response matching the request. + + - If there is a match, _fresh or stale_, it will be returned from the cache. + - If there is no match, the browser will make a normal request, and will update the cache with the downloaded resource. + + - `only-if-cached` + + - : The browser looks in its HTTP cache for a response matching the request. {{experimental_inline}} + + - If there is a match, _fresh or stale_, it will be returned from the cache. + - If there is no match, a network error is returned. + + The `"only-if-cached"` mode can only be used if the request's [`mode`](/en-US/docs/Web/API/Request/mode) is `"same-origin"`. Cached redirects will be followed if the request's `redirect` property is `"follow"` and the redirects do not violate the `"same-origin"` mode. + +- `credentials` {{optional_inline}} + + - : Controls whether or not the browser sends credentials with the request. Credentials are cookies, {{glossary("TLS")}} client certificates, or authentication headers containing a username and password. This option may be any one of the following values: + + - `omit` + - : Never send credentials in the request or include credentials in the response. + - `same-origin` + - : Only send and include credentials for same-origin requests. + - `include` + - : Always include credentials, even for cross-origin requests. + + Including credentials in cross-origin requests can make a site vulnerable to {{glossary("CSRF")}} attacks, so even if `credentials` is set to `include`, the server must also agree to their inclusion by including the {{httpheader("Access-Control-Allow-Credentials")}} in its response. Additionally, in this situation the server must explicitly specify the client's origin in the {{httpheader("Access-Control-Allow-Origin")}} response header (that is, `*` is not allowed). + + See [Including credentials](/en-US/docs/Web/API/Fetch_API/Using_Fetch#including_credentials) for more details. + + Defaults to `same-origin`. + +- `headers` {{optional_inline}} + + - : Any headers you want to add to your request, contained + within a {{domxref("Headers")}} object or an object literal whose keys are the names of headers and whose values are the header values. + + Many headers are set automatically by the browser and can't be set by a script: these are called {{glossary("Forbidden header name", "Forbidden header names")}}. + + If the `mode` option is set to `no-cors`, you can only set {{glossary("CORS-safelisted request header", "CORS-safelisted request headers")}}. + + See [Setting headers](/en-US/docs/Web/API/Fetch_API/Using_Fetch#setting_headers) for more details. + +- `integrity` + + - : Contains the [subresource integrity](/en-US/docs/Web/Security/Subresource_Integrity) + value of the request. + + This will be checked when the resource is fetched, just as it would be when the [`integrity`](/en-US/docs/Web/HTML/Element/script#integrity) attribute is set on a {{htmlelement("script")}} element. The browser will compute the {{glossary("Cryptographic_hash_function", "hash")}} of the fetched resource using the specified algorithm, and if the result does not match the value specified, the browser will reject the fetch request with a network error. + + The format of this option is `<hash-algo>-<hash-source>` where: + + - `<hash-algo>` is one of the following values:`sha256`, `sha384`, or `sha512` + - `<hash-source>` is the {{glossary("base64", "Base64-encoding")}} of the result of hashing the resource with the specified hash algorithm. + + Defaults to an empty string. + +- `keepalive` {{optional_inline}} + + - : A boolean. If `true`, the browser will not abort the request if the page that made 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. + + The body size for keepalive requests is limited to 64 kibibytes. + + Defaults to `false`. + +- `method` {{optional_inline}} + + - : The [request method](/en-US/docs/Web/HTTP/Methods). + + Defaults to {{httpmethod("GET")}}. + +- `mode` {{optional_inline}} + + - : One of the following values: + + - `same-origin` + - : Disallows cross-origin requests completely. + - `cors` + - : If the request is cross-origin then it will use the [Cross-Origin Resource Sharing (CORS)](/en-US/docs/Web/HTTP/CORS) mechanism. + - `no-cors` + - : The request must be a [simple request](/en-US/docs/Web/HTTP/CORS#simple_requests), which restricts the headers that may be set to {{glossary("CORS-safelisted request header", "CORS-safelisted request headers")}}, and restricts methods to `GET`, `HEAD`, and `POST`. + - `navigate` + - : Used only by HTML navigation. A `navigate` request is created only while navigating between documents. + - `websocket` + - : Used only when establishing a [WebSocket](/en-US/docs/Web/API/WebSockets_API) connection. + + See [Making cross-origin requests](/en-US/docs/Web/API/Fetch_API/Using_Fetch#making_cross-origin_requests) for more details. + + Defaults to `cors`. + +- `priority` {{optional_inline}} + + - : Specifies the priority of the fetch request relative to other requests of the same type. Must be one of the following: + + - `high` + - : A high priority fetch request relative to other requests of the same type. + - `low` + - : A low priority fetch request relative to other requests of the same type. + - `auto` + - : Automatically determine the priority of the fetch request relative to other requests of the same type . + + Defaults to `auto`. + +- `redirect` {{optional_inline}} + + - : Determines the browser's behavior in case the server replies with a [redirect status](/en-US/docs/Web/HTTP/Status#redirection_messages). One of the following values: + + - `follow` + - : Automatically follow redirects. + - `error` + - : Reject the promise with a network error when a redirect status is returned. + - `manual` + - : Return a response with almost all fields filtered out, to enable a service worker to store the response and later replay it. + + Defaults to `follow`. + +- `referrer` {{optional_inline}} + + - : A string specifying the value to use for the request's {{httpheader("Referer")}} header. One of the following: + + - A same-origin relative or absolute URL + - : Set the `Referer` header to the given value. Relative URLs are resolved relative to the URL of the page that made the request. + - An empty string + - : Omit the `Referer` header. + - `about:client` + - : Set the `Referer` header to the default value for the context of the request (for example, the URL of the page that made the request). + + Defaults to `about:client`. + +- `referrerPolicy` {{optional_inline}} + - : A string that sets a policy for the {{httpheader("Referer")}} header. The syntax and semantics of this option are exactly the same as for the {{httpheader("Referrer-Policy")}} header. +- `signal` {{optional_inline}} + - : An {{domxref("AbortSignal")}}. If this option is set, the request can be canceled by calling {{domxref("AbortController.abort()", "abort()")}} on the corresponding `AbortController`. + +## Examples + +### Passing options into `fetch()` + +In this example we pass the `method`, `body`, and `headers` options directly into the [`fetch()`](/en-US/docs/Web/API/fetch) method call: + +```js +async function post() { + const response = await fetch("https://example.org/post", { + method: "POST", + body: JSON.stringify({ username: "example" }), + headers: { + "Content-Type": "application/json", + }, + }); + + console.log(response.status); +} +``` + +### Passing options into the `Request()` constructor + +In this example we create a {{domxref("Request")}}, passing the same set of options into its constructor, and then pass the request into `fetch()`: + +```js +async function post() { + const request = new Request("https://example.org/post", { + method: "POST", + body: JSON.stringify({ username: "example" }), + headers: { + "Content-Type": "application/json", + }, + }); + + const response = await fetch(request); + + console.log(response.status); +} +``` + +### Passing options into both `Request()` and `fetch()` + +In this example we create a {{domxref("Request")}}, passing the `method`, `headers`, and `body` options into its constructor. We then pass the request into `fetch()` along with `body` and `referrer` options: + +```js +async function post() { + const request = new Request("https://example.org/post", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ username: "example1" }), + }); + + const response = await fetch(request, { + body: JSON.stringify({ username: "example2" }), + referrer: "", + }); + + console.log(response.status); +} +``` + +In this case the request will be sent with the following options: + +- `method: "POST"` +- `headers: {"Content-Type": "application/json"}` +- `body: '{"username":"example2"}'` +- `referrer: ""` + +## Specifications + +{{Specifications}} + +## See also + +- [Using Fetch](/en-US/docs/Web/API/Fetch_API/Using_Fetch) +- [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) diff --git a/files/jsondata/GroupData.json b/files/jsondata/GroupData.json index 4b7f98efa9b0b17..f43b052e5040e13 100644 --- a/files/jsondata/GroupData.json +++ b/files/jsondata/GroupData.json @@ -520,7 +520,7 @@ "/docs/Web/API/Fetch_API/Using_Fetch", "/docs/Web/API/Fetch_API/Cross-global_fetch_usage" ], - "interfaces": ["Headers", "Request", "Response"], + "interfaces": ["Headers", "Request", "RequestInit", "Response"], "methods": ["fetch()"], "properties": [], "events": []