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

fix(macro): update {{AvailableInWorkers}} positions, part 4 #32586

Merged
merged 1 commit into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@ status:
browser-compat: api.AudioDecoder
---

\{{APIRef("WebCodecs API")}}\{{SeeCompatTable}}\{{SecureContext_Header}}
\{{APIRef("WebCodecs API")}} \{{SeeCompatTable}} \{{SecureContext_Header}} \{{AvailableInWorkers}}
```

While most banners are inserted immediately below the page metadata, the `\{{AvailableInWorkers}}` macro is added at the bottom of the first section of text, before the first heading.

## Banners that must be added manually

You need to add the following macros manually:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,19 +245,19 @@ They can also be used to mark up a section on a page.
Should be used on main pages like interface pages, API overview pages, and API entry points (e.g. `navigator.xyz`) but usually not on subpages like method and property pages.
Example: `\{{SecureContext_Header}}` {{SecureContext_Header}}

### Indicating that a feature is available in web workers
#### Indicating that a feature is available in web workers

The [`AvailableInWorkers`](https://github.com/mdn/yari/blob/main/kumascript/macros/AvailableInWorkers.ejs) macro inserts a localized note box indicating that a feature is available in a [Web worker](/en-US/docs/Web/API/Web_Workers_API) context.
You can use the argument `notservice` to indicate that a feature works in web workers except for service workers.

#### Syntax
##### Syntax

```plain
\{{AvailableInWorkers}}
\{{AvailableInWorkers("notservice")}}
```

#### Examples
##### Examples

{{AvailableInWorkers}}
{{AvailableInWorkers("notservice")}}
Expand Down
4 changes: 1 addition & 3 deletions files/en-us/web/api/url/createobjecturl_static/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ page-type: web-api-static-method
browser-compat: api.URL.createObjectURL_static
---

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

The **`URL.createObjectURL()`** static
method creates a string containing a URL representing the object
Expand All @@ -18,8 +18,6 @@ in the window on which it was created. The new object URL represents the specifi

To release an object URL, call {{domxref("URL.revokeObjectURL_static", "revokeObjectURL()")}}.

{{AvailableInWorkers("notservice")}}

> **Note:** This feature is _not_ available in [Service Workers](/en-US/docs/Web/API/Service_Worker_API) due to its
> potential to create memory leaks.

Expand Down
4 changes: 1 addition & 3 deletions files/en-us/web/api/url/revokeobjecturl_static/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ page-type: web-api-static-method
browser-compat: api.URL.revokeObjectURL_static
---

{{ApiRef("File API")}}
{{ApiRef("File API")}} {{AvailableInWorkers("notservice")}}

The **`URL.revokeObjectURL()`** static
method releases an existing object URL which was previously created by calling
Expand All @@ -16,8 +16,6 @@ Call this method when you've finished
using an object URL to let the browser know not to keep the reference to the file any
longer.

{{AvailableInWorkers("notservice")}}

> **Note:** This method is _not_ available in [Service Workers](/en-US/docs/Web/API/Service_Worker_API), due to
> issues with the {{domxref("Blob")}} interface's life cycle and the potential for leaks.

Expand Down
4 changes: 1 addition & 3 deletions files/en-us/web/api/xmlhttprequest/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ page-type: web-api-interface
browser-compat: api.XMLHttpRequest
---

{{APIRef("XMLHttpRequest API")}}
{{APIRef("XMLHttpRequest API")}} {{AvailableInWorkers("notservice")}}

`XMLHttpRequest` (XHR) objects are used to interact with servers. You can retrieve data from a URL without having to do a full page refresh. This enables a Web page to update just part of a page without disrupting what the user is doing.

Expand All @@ -15,8 +15,6 @@ Despite its name, `XMLHttpRequest` can be used to retrieve any type of data, not

If your communication needs to involve receiving event data or message data from a server, consider using [server-sent events](/en-US/docs/Web/API/Server-sent_events) through the {{domxref("EventSource")}} interface. For full-duplex communication, [WebSockets](/en-US/docs/Web/API/WebSockets_API) may be a better choice.

{{AvailableInWorkers("notservice")}}

## Constructor

- {{domxref("XMLHttpRequest.XMLHttpRequest", "XMLHttpRequest()")}}
Expand Down
4 changes: 1 addition & 3 deletions files/en-us/web/api/xmlhttprequest_api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ browser-compat: api.XMLHttpRequest
spec-urls: https://xhr.spec.whatwg.org/
---

{{DefaultAPISidebar("XMLHttpRequest API")}}

{{AvailableInWorkers("notservice")}}
{{DefaultAPISidebar("XMLHttpRequest API")}} {{AvailableInWorkers("notservice")}}

The **XMLHttpRequest API** enables web apps to make HTTP requests to web servers and receive the responses programmatically using JavaScript. This in turn enables a website to update just part of a page with data from the server, rather than having to navigate to a whole new page. This practice is also sometimes known as {{glossary("Ajax")}}.

Expand Down
4 changes: 1 addition & 3 deletions files/en-us/web/api/xmlhttprequestupload/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ page-type: web-api-interface
browser-compat: api.XMLHttpRequestUpload
---

{{APIRef("XMLHttpRequest API")}}
{{APIRef("XMLHttpRequest API")}} {{AvailableInWorkers("notservice")}}

The **`XMLHttpRequestUpload`** interface represents the upload process for a specific {{domxref("XMLHttpRequest")}}. It is an _opaque_ object that represents the underlying, browser-dependent, upload process. It is an {{domxref("XMLHttpRequestEventTarget")}} and can be obtained by calling {{domxref("XMLHttpRequest.upload")}}.

{{AvailableInWorkers("notservice")}}

{{InheritanceDiagram}}

## Instance properties
Expand Down
Loading