summaryrefslogtreecommitdiffstats
path: root/toolkit/components/extensions/schemas/permissions.json
blob: eb66fa7c64d322ceb45049529cd1d0b800e8253d (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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
[
  {
    "namespace": "permissions",
    "types": [
      {
        "id": "Permissions",
        "type": "object",
        "properties": {
          "permissions": {
            "type": "array",
            "items": { "$ref": "manifest.OptionalPermission" },
            "optional": true,
            "default": []
          },
          "origins": {
            "type": "array",
            "items": { "$ref": "manifest.MatchPattern" },
            "optional": true,
            "default": []
          }
        }
      },
      {
        "id": "AnyPermissions",
        "type": "object",
        "properties": {
          "permissions": {
            "type": "array",
            "items": { "$ref": "manifest.Permission" },
            "optional": true,
            "default": []
          },
          "origins": {
            "type": "array",
            "items": { "$ref": "manifest.MatchPattern" },
            "optional": true,
            "default": []
          }
        }
      }
    ],
    "functions": [
      {
        "name": "getAll",
        "type": "function",
        "async": "callback",
        "description": "Get a list of all the extension's permissions.",
        "parameters": [
          {
            "name": "callback",
            "type": "function",
            "parameters": [
              {
                "name": "permissions",
                "$ref": "AnyPermissions"
              }
            ]
          }
        ]
      },
      {
        "name": "contains",
        "type": "function",
        "async": "callback",
        "description": "Check if the extension has the given permissions.",
        "parameters": [
          {
            "name": "permissions",
            "$ref": "AnyPermissions"
          },
          {
            "name": "callback",
            "type": "function",
            "parameters": [
              {
                "name": "result",
                "type": "boolean"
              }
            ]
          }
        ]
      },
      {
        "name": "request",
        "type": "function",
        "allowedContexts": ["content"],
        "async": "callback",
        "requireUserInput": true,
        "description": "Request the given permissions.",
        "parameters": [
          {
            "name": "permissions",
            "$ref": "Permissions"
          },
          {
            "name": "callback",
            "type": "function",
            "parameters": [
              {
                "name": "granted",
                "type": "boolean"
              }
            ]
          }
        ]
      },
      {
        "name": "remove",
        "type": "function",
        "async": "callback",
        "description": "Relinquish the given permissions.",
        "parameters": [
          {
            "name": "permissions",
            "$ref": "Permissions"
          },
          {
            "name": "callback",
            "type": "function",
            "parameters": []
          }
        ]
      }
    ],
    "events": [
      {
        "name": "onAdded",
        "type": "function",
        "description": "Fired when the extension acquires new permissions.",
        "parameters": [
          {
            "name": "permissions",
            "$ref": "Permissions"
          }
        ]
      },
      {
        "name": "onRemoved",
        "type": "function",
        "description": "Fired when permissions are removed from the extension.",
        "parameters": [
          {
            "name": "permissions",
            "$ref": "Permissions"
          }
        ]
      }
    ]
  }
]