nsINetworkLinkService 编辑
netwerk/base/public/nsINetworkLinkService.idl
Scriptable 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
Attribute | Type | Description |
isLinkUp | boolean | This is set to 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 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). |
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论