summaryrefslogtreecommitdiffstats
path: root/toolkit/components/extensions/schemas/captive_portal.json
blob: fd697c66ae98fc10585db31f0b273480e43da074 (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
[
  {
    "namespace": "manifest",
    "types": [
      {
        "$extend": "PermissionNoPrompt",
        "choices": [
          {
            "type": "string",
            "enum": ["captivePortal"]
          }
        ]
      }
    ]
  },
  {
    "namespace": "captivePortal",
    "description": "This API provides the ability detect the captive portal state of the users connection.",
    "permissions": ["captivePortal"],
    "properties": {
      "canonicalURL": {
        "$ref": "types.Setting",
        "description": "Return the canonical captive-portal detection URL. Read-only."
      }
    },
    "functions": [
      {
        "name": "getState",
        "type": "function",
        "description": "Returns the current portal state, one of `unknown`, `not_captive`, `unlocked_portal`, `locked_portal`.",
        "async": true,
        "parameters": []
      },
      {
        "name": "getLastChecked",
        "type": "function",
        "description": "Returns the time difference between NOW and the last time a request was completed in milliseconds.",
        "async": true,
        "parameters": []
      }
    ],
    "events": [
      {
        "name": "onStateChanged",
        "type": "function",
        "description": "Fired when the captive portal state changes.",
        "parameters": [
          {
            "type": "object",
            "name": "details",
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "unknown",
                  "not_captive",
                  "unlocked_portal",
                  "locked_portal"
                ],
                "description": "The current captive portal state."
              }
            }
          }
        ]
      },
      {
        "name": "onConnectivityAvailable",
        "type": "function",
        "description": "This notification will be emitted when the captive portal service has determined that we can connect to the internet. The service will pass either `captive` if there is an unlocked captive portal present, or `clear` if no captive portal was detected.",
        "parameters": [
          {
            "name": "status",
            "enum": ["captive", "clear"],
            "type": "string"
          }
        ]
      }
    ]
  }
]