NetworkInformation Class

The network connection of the device (https://wicg.github.io/netinfo/#networkinformation-interface), returned by Navigator.Connection and WorkerNavigator.Connection: it is read from the NetworkInformationProvider of the browsing context (NetworkInformationOptions.Provider), and fires the change event when the connection changes.

public sealed class NetworkInformation : EventTarget
Inheritance
EventTarget NetworkInformation

Properties

NameDescription
DownlinkGets the effective bandwidth of the connection, in megabits per second, rounded to a multiple of 50 kilobits per second.
DownlinkMaxGets the maximum bandwidth of the connection technology, in megabits per second, or positive infinity when it is unknown.
EffectiveTypeGets the effective type of the connection.
OnChangeGets or sets the event handler of the change event.
RttGets the effective round-trip time of the connection, in milliseconds, rounded to a multiple of 50 milliseconds.
SaveDataGets whether the user prefers a reduced data usage (https://wicg.github.io/savedata/): ClientHintsOptions.SaveData.
TypeGets the type of the connection.

Gets the maximum bandwidth of the connection technology, in megabits per second, or positive infinity when it is unknown.

public double DownlinkMax { get; }

Gets the effective type of the connection.

public EffectiveConnectionType EffectiveType { get; }

Gets or sets the event handler of the change event.

public Action<Event>? OnChange { get; set; }

Gets the effective round-trip time of the connection, in milliseconds, rounded to a multiple of 50 milliseconds.

public ulong Rtt { get; }

Gets whether the user prefers a reduced data usage (https://wicg.github.io/savedata/): ClientHintsOptions.SaveData.

public bool SaveData { get; }

Gets the type of the connection.

public ConnectionType Type { get; }