Source code

Revision control

Other Tools

1
[
2
{
3
"namespace": "manifest",
4
"types": [{
5
"$extend": "Permission",
6
"choices": [{
7
"type": "string",
8
"enum": [
9
"normandyAddonStudy"
10
]
11
}]
12
}]
13
},
14
{
15
"namespace": "normandyAddonStudy",
16
"description": "Normandy Study API",
17
"allowedContexts": ["content", "devtools"],
18
"defaultContexts": ["content", "devtools"],
19
"permissions": [
20
"normandyAddonStudy"
21
],
22
"types": [
23
{
24
"id": "Study",
25
"type": "object",
26
"properties": {
27
"recipeId": {
28
"type": "integer",
29
"description": "The ID of the recipe for the study."
30
},
31
"slug": {
32
"type": "string",
33
"description": "A slug to identify the study."
34
},
35
"userFacingName": {
36
"type": "string",
37
"description": "The name presented on about:studies."
38
},
39
"userFacingDescription": {
40
"type": "string",
41
"description": "The description presented on about:studies."
42
},
43
"branch": {
44
"type": "string",
45
"description": "The study branch in which the user is enrolled."
46
},
47
"active": {
48
"type": "boolean",
49
"description": "The state of the study."
50
},
51
"addonId": {
52
"type": "string",
53
"description": "The ID of the extension installed by the study."
54
},
55
"addonUrl": {
56
"type": "string",
57
"description": "The URL of the XPI that was downloaded and installed by the study."
58
},
59
"addonVersion": {
60
"type": "string",
61
"description": "The version of the extension installed by the study."
62
},
63
"studyStartDate": {
64
"$ref": "extensionTypes.Date",
65
"description": "The start date for the study."
66
},
67
"studyEndDate": {
68
"$ref": "extensionTypes.Date",
69
"description": "The end date for the study."
70
},
71
"extensionApiId": {
72
"type": "integer",
73
"description": "The record ID for the extension in Normandy server's database."
74
},
75
"extensionHash": {
76
"type": "string",
77
"description": "A hash of the extension XPI file."
78
},
79
"extensionHashAlgorithm": {
80
"type": "string",
81
"description": "The algorithm used to hash the extension XPI file."
82
}
83
}
84
}
85
],
86
"functions": [
87
{
88
"name": "getStudy",
89
"type": "function",
90
"description": "Returns a study object for the current study.",
91
"async": true,
92
"parameters": []
93
},
94
{
95
"name": "endStudy",
96
"type": "function",
97
"description": "Marks the study as ended and then uninstalls the addon.",
98
"async": true,
99
"parameters": [
100
{
101
"type": "string",
102
"name": "reason",
103
"description": "The reason why the study is ending."
104
}
105
]
106
},
107
{
108
"name": "getClientMetadata",
109
"type": "function",
110
"description": "Returns an object with metadata about the client which may be required for constructing survey URLs.",
111
"async": true,
112
"parameters": []
113
}
114
],
115
"events": [
116
{
117
"name": "onUnenroll",
118
"type": "function",
119
"description": "Fired when a user unenrolls from a study but before the addon is uninstalled.",
120
"parameters": [
121
{
122
"type": "string",
123
"name": "reason",
124
"description": "The reason why the study is ending."
125
}
126
]
127
}
128
]
129
}
130
]