nsINetworkLinkService

Network link status monitoring service.
1.0
29.0.1
Introduced
Gecko 1.8
Inherits from: nsISupports Last changed in Gecko 8.0 (Firefox 8.0 / Thunderbird 8.0 / SeaMonkey 2.5)

Implemented by: @mozilla.org/network/network-link-service;1 as a service:

var networkLinkService = Components.classes["@mozilla.org/network/network-link-service;1"]
                         .getService(Components.interfaces.nsINetworkLinkService);

Attributes

Attribute Type Description
isLinkUp boolean

This is set to true when the system is believed to have a usable network connection.

The link is only up when network connections can be established. For example, the link is down during DHCP configuration (unless there is another usable interface already configured).

If the link status is not currently known, we generally assume that it is up. Read only.
linkStatusKnown boolean This is set to true when we believe that isLinkUp is accurate. Read only.
linkType unsigned long The type of network connection, one of the LINK_TYPE_* constants. Read only.

Note: As of Gecko 8.0, all Operating Systems currently return LINK_TYPE_UNKNOWN. Android support was backed out due to perceived security concerns, see bug 691054.

As of Gecko 28.0 Android support is available again, see bug 939680.

Constants

Constant Value Description
LINK_TYPE_UNKNOWN 0 We were unable to determine the network connection type.
LINK_TYPE_ETHERNET 1 A standard wired Ethernet connection.
LINK_TYPE_USB 2 A connection via a USB port.
LINK_TYPE_WIFI 3 A connection via a WiFi access point (IEEE802.11).
LINK_TYPE_WIMAX 4 A connection via WiMax (IEEE802.16).
LINK_TYPE_2G 5 A '2G' mobile connection (for example, GSM, GPRS, EDGE).
LINK_TYPE_3G 6 A '3G' mobile connection (for example, UMTS, CDMA).
LINK_TYPE_4G 7 A '4G' mobile connection (for example, LTE, UMB).

 

Document Tags and Contributors

Contributors to this page: Nmaier, Sheppy, kscarfone, trevorh
Last updated by: Nmaier,