Source code

Revision control

Other Tools

1
[
2
{
3
"namespace": "manifest",
4
"types": [{
5
"$extend": "Permission",
6
"choices": [{
7
"type": "string",
8
"enum": [
9
"telemetry"
10
]
11
}]
12
}]
13
},
14
{
15
"namespace": "telemetry",
16
"description": "Use the <code>browser.telemetry</code> API to send telemetry data to the Mozilla Telemetry service. Restricted to Mozilla privileged webextensions.",
17
"types": [{
18
"id": "ScalarType",
19
"type": "string",
20
"enum": ["count", "string", "boolean"],
21
"description": "Type of scalar: 'count' for numeric values, 'string' for string values, 'boolean' for boolean values. Maps to <code>nsITelemetry.SCALAR_TYPE_*</code>."
22
}, {
23
"id": "ScalarData",
24
"type": "object",
25
"description": "Represents registration data for a Telemetry scalar.",
26
"properties": {
27
"kind": {
28
"$ref": "ScalarType"
29
},
30
"keyed": {
31
"type": "boolean",
32
"optional": true,
33
"default": false,
34
"description": "True if this is a keyed scalar."
35
},
36
"record_on_release": {
37
"type": "boolean",
38
"optional": true,
39
"default": false,
40
"description": "True if this data should be recorded on release."
41
},
42
"expired": {
43
"type": "boolean",
44
"optional": true,
45
"default": false,
46
"description": "True if this scalar entry is expired. This allows recording it without error, but it will be discarded."
47
}
48
}
49
}, {
50
"id": "EventData",
51
"type": "object",
52
"description": "Represents registration data for a Telemetry event.",
53
"properties": {
54
"methods": {
55
"type": "array",
56
"items": { "type": "string" },
57
"description": "List of methods for this event entry."
58
},
59
"objects": {
60
"type": "array",
61
"items": { "type": "string" },
62
"description": "List of objects for this event entry."
63
},
64
"extra_keys": {
65
"type": "array",
66
"items": { "type": "string" },
67
"description": "List of allowed extra keys for this event entry."
68
},
69
"record_on_release": {
70
"type": "boolean",
71
"optional": true,
72
"default": false,
73
"description": "True if this data should be recorded on release."
74
},
75
"expired": {
76
"type": "boolean",
77
"optional": true,
78
"default": false,
79
"description": "True if this event entry is expired. This allows recording it without error, but it will be discarded."
80
}
81
}
82
}],
83
"permissions": ["telemetry"],
84
"functions": [{
85
"name": "submitPing",
86
"type": "function",
87
"description": "Submits a custom ping to the Telemetry back-end. See <code>submitExternalPing</code> inside TelemetryController.jsm for more details.",
88
"async": true,
89
"parameters": [
90
{
91
"name": "type",
92
"type": "string",
93
"pattern": "^[a-z0-9][a-z0-9-]+[a-z0-9]$",
94
"description": "The type of the ping."
95
},
96
{
97
"name": "message",
98
"type": "object",
99
"additionalProperties": { "type": "any" },
100
"description": "The data payload for the ping."
101
},
102
{
103
"description": "Options object.",
104
"name": "options",
105
"type": "object",
106
"properties": {
107
"addClientId": {
108
"type": "boolean",
109
"optional": true,
110
"default": false,
111
"description": "True if the ping should contain the client id."
112
},
113
"addEnvironment": {
114
"type": "boolean",
115
"optional": true,
116
"default": false,
117
"description": "True if the ping should contain the environment data."
118
},
119
"overrideEnvironment": {
120
"type": "object",
121
"additionalProperties": { "type": "any" },
122
"optional": true,
123
"default": false,
124
"description": "Set to override the environment data."
125
},
126
"usePingSender": {
127
"type": "boolean",
128
"optional": true,
129
"default": false,
130
"description": "If true, send the ping using the PingSender."
131
}
132
}
133
}
134
]
135
},
136
{
137
"name": "canUpload",
138
"type": "function",
139
"description": "Checks if Telemetry upload is enabled.",
140
"parameters": [],
141
"async": true
142
},
143
{
144
"name": "scalarAdd",
145
"type": "function",
146
"description": "Adds the value to the given scalar.",
147
"async": true,
148
"parameters": [
149
{
150
"name": "name",
151
"type": "string",
152
"description": "The scalar name."
153
},
154
{
155
"name": "value",
156
"type": "integer",
157
"minimum": 1,
158
"description": "The numeric value to add to the scalar. Only unsigned integers supported."
159
}
160
]
161
},
162
{
163
"name": "scalarSet",
164
"type": "function",
165
"description": "Sets the named scalar to the given value. Throws if the value type doesn't match the scalar type.",
166
"async": true,
167
"parameters": [
168
{
169
"name": "name",
170
"type": "string",
171
"description": "The scalar name"
172
},
173
{
174
"name": "value",
175
"description": "The value to set the scalar to",
176
"choices": [
177
{ "type": "string" },
178
{ "type": "boolean" },
179
{ "type": "integer" },
180
{ "type": "object", "additionalProperties": { "type": "any" } }
181
]
182
}
183
]
184
},
185
{
186
"name": "scalarSetMaximum",
187
"type": "function",
188
"description": "Sets the scalar to the maximum of the current and the passed value",
189
"async": true,
190
"parameters": [
191
{
192
"name": "name",
193
"type": "string",
194
"description": "The scalar name."
195
},
196
{
197
"name": "value",
198
"type": "integer",
199
"minimum": 0,
200
"description": "The numeric value to set the scalar to. Only unsigned integers supported."
201
}
202
]
203
},
204
{
205
"name": "keyedScalarAdd",
206
"type": "function",
207
"description": "Adds the value to the given keyed scalar.",
208
"async": true,
209
"parameters": [
210
{
211
"name": "name",
212
"type": "string",
213
"description": "The scalar name"
214
},
215
{
216
"name": "key",
217
"type": "string",
218
"description": "The key name"
219
},
220
{
221
"name": "value",
222
"type": "integer",
223
"minimum": 1,
224
"description": "The numeric value to add to the scalar. Only unsigned integers supported."
225
}
226
]
227
},
228
{
229
"name": "keyedScalarSet",
230
"type": "function",
231
"description": "Sets the keyed scalar to the given value. Throws if the value type doesn't match the scalar type.",
232
"async": true,
233
"parameters": [
234
{
235
"name": "name",
236
"type": "string",
237
"description": "The scalar name."
238
},
239
{
240
"name": "key",
241
"type": "string",
242
"description": "The key name."
243
},
244
{
245
"name": "value",
246
"description": "The value to set the scalar to.",
247
"choices": [
248
{ "type": "string" },
249
{ "type": "boolean" },
250
{ "type": "integer" },
251
{ "type": "object", "additionalProperties": { "type": "any" } }
252
]
253
}
254
]
255
},
256
{
257
"name": "keyedScalarSetMaximum",
258
"type": "function",
259
"description": "Sets the keyed scalar to the maximum of the current and the passed value",
260
"async": true,
261
"parameters": [
262
{
263
"name": "name",
264
"type": "string",
265
"description": "The scalar name."
266
},
267
{
268
"name": "key",
269
"type": "string",
270
"description": "The key name."
271
},
272
{
273
"name": "value",
274
"type": "integer",
275
"minimum": 0,
276
"description": "The numeric value to set the scalar to. Only unsigned integers supported."
277
}
278
]
279
},
280
{
281
"name": "recordEvent",
282
"type": "function",
283
"description": "Record an event in Telemetry. Throws when trying to record an unknown event.",
284
"async": true,
285
"parameters": [
286
{
287
"name": "category",
288
"type": "string",
289
"description": "The category name."
290
},
291
{
292
"name": "method",
293
"type": "string",
294
"description": "The method name."
295
},
296
{
297
"name": "object",
298
"type": "string",
299
"description": "The object name."
300
},
301
{
302
"name": "value",
303
"type": "string",
304
"optional": true,
305
"description": "An optional string value to record."
306
},
307
{
308
"name": "extra",
309
"type": "object",
310
"optional": true,
311
"description": "An optional object of the form (string -> string). It should only contain registered extra keys.",
312
"additionalProperties": { "type": "string" }
313
}
314
]
315
},
316
317
{
318
"name": "registerScalars",
319
"type": "function",
320
"description": "Register new scalars to record them from addons. See nsITelemetry.idl for more details.",
321
"async": true,
322
"parameters": [
323
{
324
"name": "category",
325
"type": "string",
326
"description": "The unique category the scalars are registered in."
327
},
328
{
329
"name": "data",
330
"type": "object",
331
"additionalProperties": { "$ref": "ScalarData" },
332
"description": "An object that contains registration data for multiple scalars. Each property name is the scalar name, and the corresponding property value is an object of ScalarData type."
333
}
334
]
335
},
336
{
337
"name": "registerEvents",
338
"type": "function",
339
"description": "Register new events to record them from addons. See nsITelemetry.idl for more details.",
340
"async": true,
341
"parameters": [
342
{
343
"name": "category",
344
"type": "string",
345
"description": "The unique category the events are registered in."
346
},
347
{
348
"name": "data",
349
"type": "object",
350
"additionalProperties": { "$ref": "EventData" },
351
"description": "An object that contains registration data for 1+ events. Each property name is the category name, and the corresponding property value is an object of EventData type."
352
}
353
]
354
},
355
{
356
"name": "setEventRecordingEnabled",
357
"type": "function",
358
"description": "Enable recording of events in a category. Events default to recording disabled. This allows to toggle recording for all events in the specified category.",
359
"async": true,
360
"parameters": [
361
{
362
"name": "category",
363
"type": "string",
364
"description": "The category name."
365
},
366
{
367
"name": "enabled",
368
"type": "boolean",
369
"description": "Whether recording is enabled for events in that category."
370
}
371
]
372
}]
373
}
374
]