nsINetworkLinkService 编辑

netwerk/base/public/nsINetworkLinkService.idlScriptable Network link status monitoring service. 1.0 66 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

AttributeTypeDescription
isLinkUpboolean

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.
linkStatusKnownbooleanThis is set to true when we believe that isLinkUp is accurate. Read only.
linkTypeunsigned longThe 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

ConstantValueDescription
LINK_TYPE_UNKNOWN0We were unable to determine the network connection type.
LINK_TYPE_ETHERNET1A standard wired Ethernet connection.
LINK_TYPE_USB2A connection via a USB port.
LINK_TYPE_WIFI3A connection via a WiFi access point (IEEE802.11).
LINK_TYPE_WIMAX4A connection via WiMax (IEEE802.16).
LINK_TYPE_2G5A '2G' mobile connection (for example, GSM, GPRS, EDGE).
LINK_TYPE_3G6A '3G' mobile connection (for example, UMTS, CDMA).
LINK_TYPE_4G7A '4G' mobile connection (for example, LTE, UMB).

 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:51 次

字数:4056

最后编辑:8年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文