1{
2  "title": "ExtensionDoorhanger",
3  "description": "A template with a heading, addon icon, title and description. No markup allowed.",
4  "version": "1.0.0",
5  "type": "object",
6  "definitions": {
7    "plainText": {
8      "description": "Plain text (no HTML allowed)",
9      "type": "string"
10    },
11    "linkUrl": {
12      "description": "Target for links or buttons",
13      "type": "string",
14      "format": "uri"
15    }
16  },
17  "properties": {
18    "category": {
19      "type": "string",
20      "description": "Attribute used for different groups of messages from the same provider"
21    },
22    "layout": {
23      "type": "string",
24      "description": "Attribute used for different groups of messages from the same provider",
25      "enum": ["short_message", "icon_and_message", "addon_recommendation"]
26    },
27    "anchor_id": {
28      "type": "string",
29      "description": "A DOM element ID that the pop-over will be anchored."
30    },
31    "bucket_id": {
32      "type": "string",
33      "description": "A bucket identifier for the addon. This is used in order to anonymize telemetry for history-sensitive targeting."
34    },
35    "skip_address_bar_notifier": {
36      "type": "boolean",
37      "description": "Skip the 'Recommend' notifier and show directly."
38    },
39    "persistent_doorhanger": {
40      "type": "boolean",
41      "description": "Prevent the doorhanger from being dismissed if user interacts with the page or switches between applications."
42    },
43    "notification_text": {
44      "description": "The text in the small blue chicklet that appears in the URL bar. This can be a reference to a localized string in Firefox or just a plain string.",
45      "oneOf": [
46        {
47          "type": "string",
48          "description": "Message shown in the location bar notification."
49        },
50        {
51          "type": "object",
52          "properties": {
53            "string_id": {
54              "type": "string",
55              "description": "Id of localized string for the location bar notification."
56            }
57          },
58          "required": ["string_id"]
59        }
60      ]
61    },
62    "info_icon": {
63      "type": "object",
64      "description": "The small icon displayed in the top right corner of the pop-over. Should be 19x19px, svg or png. Defaults to a small question mark.",
65      "properties": {
66        "label": {
67          "oneOf": [
68            {
69              "type": "object",
70              "properties": {
71                "attributes": {
72                  "type": "object",
73                  "properties": {
74                    "tooltiptext": {
75                      "type": "string",
76                      "description": "Text for button tooltip used to provide information about the doorhanger."
77                    }
78                  },
79                  "required": ["tooltiptext"]
80                }
81              },
82              "required": ["attributes"]
83            },
84            {
85              "type": "object",
86              "properties": {
87                "string_id": {
88                  "type": "string",
89                  "description": "Id of localized string used to provide information about the doorhanger."
90                }
91              },
92              "required": ["string_id"]
93            }
94          ]
95        },
96        "sumo_path": {
97          "type": "string",
98          "description": "Last part of the path in the URL to the support page with the information about the doorhanger.",
99          "examples": ["extensionpromotions", "extensionrecommendations"]
100        }
101      }
102    },
103    "learn_more": {
104      "type": "string",
105      "description": "Last part of the path in the SUMO URL to the support page with the information about the doorhanger.",
106      "examples": ["extensionpromotions", "extensionrecommendations"]
107    },
108    "heading_text": {
109      "description": "The larger heading text displayed in the pop-over. This can be a reference to a localized string in Firefox or just a plain string.",
110      "oneOf": [
111        {
112          "type": "string",
113          "description": "The message displayed in the title of the extension doorhanger"
114        },
115        {
116          "type": "object",
117          "properties": {
118            "string_id": {
119              "type": "string"
120            }
121          },
122          "required": ["string_id"],
123          "description": "Id of localized string for extension doorhanger title"
124        }
125      ]
126    },
127    "icon": {
128      "description": "The icon displayed in the pop-over. Should be 32x32px or 64x64px and png/svg.",
129      "allOf": [
130        { "$ref": "#/definitions/linkUrl" },
131        { "description": "Icon associated with the message" }
132      ]
133    },
134    "icon_dark_theme": {
135      "type": "string",
136      "description": "Pop-over icon, dark theme variant. Should be 32x32px or 64x64px and png/svg."
137    },
138    "icon_class": {
139      "type": "string",
140      "description": "CSS class of the pop-over icon."
141    },
142    "addon": {
143      "description": "Addon information including AMO URL.",
144      "type": "object",
145      "properties": {
146        "id": {
147          "allOf": [
148            { "$ref": "#/definitions/plainText" },
149            { "description": "Unique addon ID" }
150          ]
151        },
152        "title": {
153          "allOf": [
154            { "$ref": "#/definitions/plainText" },
155            { "description": "Addon name" }
156          ]
157        },
158        "author": {
159          "allOf": [
160            { "$ref": "#/definitions/plainText" },
161            { "description": "Addon author" }
162          ]
163        },
164        "icon": {
165          "description": "The icon displayed in the pop-over. Should be 64x64px and png/svg.",
166          "allOf": [
167            { "$ref": "#/definitions/linkUrl" },
168            { "description": "Addon icon" }
169          ]
170        },
171        "rating": {
172          "type": "number",
173          "minimum": 0,
174          "maximum": 5,
175          "description": "Star rating"
176        },
177        "users": {
178          "type": "integer",
179          "minimum": 0,
180          "description": "Installed users"
181        },
182        "amo_url": {
183          "allOf": [
184            { "$ref": "#/definitions/linkUrl" },
185            {
186              "description": "Link that offers more information related to the addon."
187            }
188          ]
189        }
190      },
191      "required": ["title", "author", "icon", "amo_url"]
192    },
193    "text": {
194      "description": "The body text displayed in the pop-over. This can be a reference to a localized string in Firefox or just a plain string.",
195      "oneOf": [
196        {
197          "type": "string",
198          "description": "Description message of the addon."
199        },
200        {
201          "type": "object",
202          "properties": {
203            "string_id": {
204              "type": "string",
205              "description": "Id of string to localized addon description"
206            }
207          },
208          "required": ["string_id"]
209        }
210      ]
211    },
212    "descriptionDetails": {
213      "description": "Additional information and steps on how to use",
214      "type": "object",
215      "properties": {
216        "steps": {
217          "description": "Array of messages or string_ids",
218          "type": "array",
219          "items": {
220            "type": "object",
221            "properties": {
222              "string_id": {
223                "type": "string",
224                "description": "Id of string to localized addon description"
225              }
226            },
227            "required": ["string_id"]
228          }
229        }
230      },
231      "required": ["steps"]
232    },
233    "buttons": {
234      "description": "The label and functionality for the buttons in the pop-over.",
235      "type": "object",
236      "properties": {
237        "primary": {
238          "type": "object",
239          "properties": {
240            "label": {
241              "type": "object",
242              "oneOf": [
243                {
244                  "properties": {
245                    "value": {
246                      "allOf": [
247                        { "$ref": "#/definitions/plainText" },
248                        {
249                          "description": "Button label override used when a localized version is not available."
250                        }
251                      ]
252                    },
253                    "attributes": {
254                      "type": "object",
255                      "properties": {
256                        "accesskey": {
257                          "type": "string",
258                          "description": "A single character to be used as a shortcut key for the secondary button. This should be one of the characters that appears in the button label."
259                        }
260                      },
261                      "required": ["accesskey"],
262                      "description": "Button attributes."
263                    }
264                  },
265                  "required": ["value", "attributes"]
266                },
267                {
268                  "properties": {
269                    "string_id": {
270                      "allOf": [
271                        { "$ref": "#/definitions/plainText" },
272                        { "description": "Id of localized string for button" }
273                      ]
274                    }
275                  },
276                  "required": ["string_id"]
277                }
278              ],
279              "description": "Id of localized string or message override."
280            },
281            "action": {
282              "type": "object",
283              "properties": {
284                "type": {
285                  "type": "string",
286                  "description": "Action dispatched by the button."
287                },
288                "data": {
289                  "properties": {
290                    "url": {
291                      "type": "string",
292                      "$comment": "This is dynamically generated from the addon.id. See CFRPageActions.jsm",
293                      "description": "URL used in combination with the primary action dispatched."
294                    }
295                  }
296                }
297              }
298            }
299          },
300          "secondary": {
301            "type": "object",
302            "properties": {
303              "label": {
304                "type": "object",
305                "oneOf": [
306                  {
307                    "properties": {
308                      "value": {
309                        "allOf": [
310                          { "$ref": "#/definitions/plainText" },
311                          {
312                            "description": "Button label override used when a localized version is not available."
313                          }
314                        ]
315                      },
316                      "attributes": {
317                        "type": "object",
318                        "properties": {
319                          "accesskey": {
320                            "type": "string",
321                            "description": "A single character to be used as a shortcut key for the secondary button. This should be one of the characters that appears in the button label."
322                          }
323                        },
324                        "required": ["accesskey"],
325                        "description": "Button attributes."
326                      }
327                    },
328                    "required": ["value", "attributes"]
329                  },
330                  {
331                    "properties": {
332                      "string_id": {
333                        "allOf": [
334                          { "$ref": "#/definitions/plainText" },
335                          { "description": "Id of localized string for button" }
336                        ]
337                      }
338                    },
339                    "required": ["string_id"]
340                  }
341                ],
342                "description": "Id of localized string or message override."
343              },
344              "action": {
345                "type": "object",
346                "properties": {
347                  "type": {
348                    "type": "string",
349                    "description": "Action dispatched by the button."
350                  },
351                  "data": {
352                    "properties": {
353                      "url": {
354                        "allOf": [
355                          { "$ref": "#/definitions/linkUrl" },
356                          {
357                            "description": "URL used in combination with the primary action dispatched."
358                          }
359                        ]
360                      }
361                    }
362                  }
363                }
364              }
365            }
366          }
367        }
368      }
369    }
370  },
371  "additionalProperties": false,
372  "required": [
373    "layout",
374    "category",
375    "bucket_id",
376    "notification_text",
377    "heading_text",
378    "text",
379    "buttons"
380  ]
381}
382