Skip to content

Commit

Permalink
Network Information API | add missing WorkerNavigator.connection me…
Browse files Browse the repository at this point in the history
…mber & update contents list (#32220)

* update front matter keys

* update api groupdata

* text update

* update extensions list

* update content

* update desc

* run lint

* downlink - just layout fixes

* Update index.md

* Update index.md

* Update index.md

* Update index.md

* Update index.md

---------

Co-authored-by: Hamish Willee <[email protected]>
  • Loading branch information
skyclouds2001 and hamishwillee authored Mar 24, 2024
1 parent 8d54a21 commit 5671055
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 31 deletions.
2 changes: 1 addition & 1 deletion files/en-us/web/api/navigator/connection/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ browser-compat: api.Navigator.connection

{{APIRef("Network Information API")}}{{SeeCompatTable}}

The **`Navigator.connection`** read-only property returns a {{domxref("NetworkInformation")}} object containing information about the system's connection, such as the current bandwidth of the user's device or whether the connection is metered.
The **`connection`** read-only property of the {{domxref("Navigator")}} interface returns a {{domxref("NetworkInformation")}} object containing information about the system's connection, such as the current bandwidth of the user's device or whether the connection is metered.

This could be used to select high definition content or low definition content based on the user's connection.

Expand Down
16 changes: 12 additions & 4 deletions files/en-us/web/api/network_information_api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,27 @@ status:
browser-compat:
- api.NetworkInformation
- api.Navigator.connection
spec-urls: https://wicg.github.io/netinfo/
---

{{DefaultAPISidebar("Network Information API")}}{{SeeCompatTable}} {{AvailableInWorkers}}

The Network Information API provides information about the system's connection in terms of general connection type (e.g., 'wifi, 'cellular', etc.).
The **Network Information API** provides information about the system's connection in terms of general connection type (e.g., 'wifi, 'cellular', etc.).
This can be used to select high definition content or low definition content based on the user's connection.

The interface consists of a single {{domxref("NetworkInformation")}} object, an instance of which is returned by the {{domxref("Navigator.connection")}} property.
The interface consists of a single {{domxref("NetworkInformation")}} object, an instance of which is returned by the {{domxref("Navigator.connection")}} property or the {{domxref("WorkerNavigator.connection")}} property.

## Interfaces

- {{domxref("NetworkInformation")}}
- : Provides information about the connection a device is using to communicate with the network and provides a means for scripts to be notified if the connection type changes. The `NetworkInformation` interface cannot be instantiated. It is instead accessed through the {{domxref("Navigator")}} interface.
- {{domxref("NetworkInformation")}} {{Experimental_Inline}}
- : Provides information about the connection a device is using to communicate with the network and provides a means for scripts to be notified if the connection type changes. The `NetworkInformation` interface cannot be instantiated. It is instead accessed through the {{domxref("Navigator")}} interface or the {{domxref("WorkerNavigator")}} interface.

### Extensions to other interfaces

- {{domxref("Navigator.connection")}} {{ReadOnlyInline}} {{Experimental_Inline}}
- : Returns a {{domxref("NetworkInformation")}} object containing information about the network connection of a device.
- {{domxref("WorkerNavigator.connection")}} {{ReadOnlyInline}}
- : Provides a {{domxref("NetworkInformation")}} object containing information about the network connection of a device.

## Examples

Expand Down
3 changes: 1 addition & 2 deletions files/en-us/web/api/networkinformation/change_event/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ browser-compat: api.NetworkInformation.change_event

{{apiref("Network Information API")}}{{SeeCompatTable}}

The **`change`** event fires when connection information changes, and the event
is received by the {{domxref("NetworkInformation")}} object.
The **`change`** event of the {{domxref("NetworkInformation")}} interface fires when connection information changes, and the event is received by the {{domxref("NetworkInformation")}} object.

## Syntax

Expand Down
9 changes: 3 additions & 6 deletions files/en-us/web/api/networkinformation/downlinkmax/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,15 @@ browser-compat: api.NetworkInformation.downlinkMax

{{APIRef("Network Information API")}}{{SeeCompatTable}} {{AvailableInWorkers}}

The **`NetworkInformation.downlinkMax`** read-only property
returns the maximum downlink speed, in megabits per second (Mbps), for the underlying
connection technology.
The **`downlinkMax`** read-only property of the {{domxref("NetworkInformation")}} interface returns the maximum downlink speed, in megabits per second (Mbps), for the underlying connection technology.

## Value

An `unrestricted double` representing the maximum downlink speed, in megabits per second (Mb/s), for the underlying connection technology.
An number representing the maximum downlink speed, in megabits per second (Mb/s), for the underlying connection technology.

## Examples

The following example monitors the connection using the `change` event and
logs changes as they occur.
The following example monitors the connection using the `change` event and logs changes as they occur.

```js
function logConnectionType() {
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/networkinformation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ browser-compat: api.NetworkInformation
{{APIRef("Network Information API")}}{{SeeCompatTable}} {{AvailableInWorkers}}

The **`NetworkInformation`** interface of the [Network Information API](/en-US/docs/Web/API/Network_Information_API) provides information about the connection a device is using to communicate with the network and provides a means for scripts to be notified if the connection type changes.
The `NetworkInformation` interface cannot be instantiated. It is instead accessed through the `connection` property of the {{domxref("Navigator")}} interface.
The `NetworkInformation` interface cannot be instantiated. It is instead accessed through the `connection` property of the {{domxref("Navigator")}} interface or the {{domxref("WorkerNavigator")}} interface.

{{InheritanceDiagram}}

Expand Down
10 changes: 4 additions & 6 deletions files/en-us/web/api/networkinformation/rtt/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ browser-compat: api.NetworkInformation.rtt

{{apiref("Network Information API")}}{{SeeCompatTable}} {{AvailableInWorkers}}

The **`NetworkInformation.rtt`** read-only property returns the
estimated effective round-trip time of the current connection, rounded to the nearest
multiple of 25 milliseconds. This value is based on recently observed application-layer
RTT measurements across recently active connections. It excludes connections made to a
private address space. If no recent measurement data is available, the value is based on
the properties of the underlying connection technology.
The **`rtt`** read-only property of the {{domxref("NetworkInformation")}} interface returns the estimated effective round-trip time of the current connection, rounded to the nearest multiple of 25 milliseconds.
This value is based on recently observed application-layer RTT measurements across recently active connections.
It excludes connections made to a private address space.
If no recent measurement data is available, the value is based on the properties of the underlying connection technology.

## Value

Expand Down
5 changes: 2 additions & 3 deletions files/en-us/web/api/networkinformation/savedata/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ browser-compat: api.NetworkInformation.saveData

{{APIRef("Network Information API")}}{{SeeCompatTable}}

The **`NetworkInformation.saveData`** read-only
property of the {{domxref("NetworkInformation")}} interface returns `true` if
the user has set a reduced data usage option on the user agent.
The **`saveData`** read-only
property of the {{domxref("NetworkInformation")}} interface returns `true` if the user has set a reduced data usage option on the user agent.

## Value

Expand Down
3 changes: 1 addition & 2 deletions files/en-us/web/api/networkinformation/type/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ browser-compat: api.NetworkInformation.type

{{apiref("Network Information API")}}{{SeeCompatTable}} {{AvailableInWorkers}}

The **`NetworkInformation.type`** read-only property returns
the type of connection a device is using to communicate with the network.
The **`type`** read-only property of the {{domxref("NetworkInformation")}} interface returns the type of connection a device is using to communicate with the network.

## Value

Expand Down
7 changes: 2 additions & 5 deletions files/en-us/web/api/workernavigator/connection/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@ browser-compat: api.WorkerNavigator.connection

{{APIRef("Network Information API")}}

The **`WorkerNavigator.connection`** read-only property returns
a {{domxref("NetworkInformation")}} object containing information about the system's
connection, such as the current bandwidth of the user's device or whether the connection
is metered. This could be used to select high definition content or low definition
content based on the user's connection.
The **`connection`** read-only property of the {{domxref("WorkerNavigator")}} interface returns a {{domxref("NetworkInformation")}} object containing information about the system's connection, such as the current bandwidth of the user's device or whether the connection is metered.
This could be used to select high definition content or low definition content based on the user's connection.

## Value

Expand Down
2 changes: 1 addition & 1 deletion files/jsondata/GroupData.json
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@
"overview": ["Network Information API"],
"interfaces": ["NetworkInformation"],
"methods": [],
"properties": ["Navigator.connection"],
"properties": ["Navigator.connection", "WorkerNavigator.connection"],
"events": []
},
"Page Visibility API": {
Expand Down

0 comments on commit 5671055

Please sign in to comment.