Table of Contents

Class NetworkInformation

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The NetworkInformation interface of the 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 Navigator interface or the WorkerNavigator interface.

[Value("NetworkInformation")]
public class NetworkInformation : EventTarget, NetworkInformationSaveData
Inheritance
NetworkInformation
Implements
Inherited Members

Remarks

Constructors

NetworkInformation()

public NetworkInformation()

Properties

The downlink read-only property of the
NetworkInformation interface returns the effective bandwidth estimate in
megabits per second, rounded to the nearest multiple of 25 kilobits per seconds. This
value is based on recently observed application layer throughput across recently active
connections, excluding connections made to a private address space. In the absence of
recent bandwidth measurement data, the attribute value is determined by the properties
of the underlying connection technology.

[Value("downlink")]
public double Downlink { get; }

Property Value

double

A number.

DownlinkMax

NOTE
Experimental
The downlinkMax read-only property of the NetworkInformation interface returns the maximum downlink speed, in megabits per second (Mbps), for the underlying connection technology.
[Value("downlinkMax")]
public double DownlinkMax { get; }

Property Value

double

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

Remarks

EffectiveType

The effectiveType read-only property of the
NetworkInformation interface returns the effective type of the connection
meaning one of slow-2g, 2g, 3g, or 4g. This value is determined using a
combination of recently observed, round-trip time and downlink values.

[Value("effectiveType")]
public EffectiveConnectionType EffectiveType { get; }

Property Value

EffectiveConnectionType

A string that is either slow-2g, 2g, 3g, or 4g.

Remarks

Onchange

[Value("onchange")]
public EventHandlerNonNull Onchange { get; set; }

Property Value

EventHandlerNonNull

Rtt

The rtt read-only property of the 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("rtt")]
public ulong Rtt { get; }

Property Value

ulong

A number.

Remarks

Type

NOTE
Experimental
The type read-only property of the NetworkInformation interface returns the type of connection a device is using to communicate with the network.
[Value("type")]
public ConnectionType Type { get; }

Property Value

ConnectionType

An enumerated value that is one of the following values:

Remarks