summaryrefslogtreecommitdiffstats
path: root/toolkit/components/extensions/schemas/network_status.json
blob: bf2c9cb494163d330b288d8ab67176a76f612055 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
[
  {
    "namespace": "manifest",
    "types": [
      {
        "$extend": "PermissionPrivileged",
        "choices": [
          {
            "type": "string",
            "enum": ["networkStatus"]
          }
        ]
      }
    ]
  },
  {
    "namespace": "networkStatus",
    "description": "This API provides the ability to determine the status of and detect changes in the network connection. This API can only be used in privileged extensions.",
    "permissions": ["networkStatus"],
    "types": [
      {
        "id": "NetworkLinkInfo",
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": ["unknown", "up", "down"],
            "description": "Status of the network link, if \"unknown\" then link is usually assumed to be \"up\""
          },
          "type": {
            "type": "string",
            "enum": ["unknown", "ethernet", "usb", "wifi", "wimax", "mobile"],
            "description": "If known, the type of network connection that is avialable."
          },
          "id": {
            "type": "string",
            "optional": true,
            "description": "If known, the network id or name."
          }
        }
      }
    ],
    "functions": [
      {
        "name": "getLinkInfo",
        "type": "function",
        "description": "Returns the $(ref:NetworkLinkInfo} of the current network connection.",
        "async": true,
        "parameters": []
      }
    ],
    "events": [
      {
        "name": "onConnectionChanged",
        "type": "function",
        "description": "Fired when the network connection state changes.",
        "parameters": [
          {
            "name": "details",
            "$ref": "NetworkLinkInfo"
          }
        ]
      }
    ]
  }
]