1// This Source Code Form is subject to the terms of the Mozilla Public
2// License, v. 2.0. If a copy of the MPL was not distributed with this
3// file, You can obtain one at http://mozilla.org/MPL/2.0/.
4
5[
6  {
7    "namespace": "manifest",
8    "types": [
9      {
10        "$extend": "PermissionNoPrompt",
11        "choices": [{
12          "type": "string",
13          "enum": [
14            "theme"
15          ]
16        }]
17      },
18      {
19        "id": "ThemeColor",
20        "choices": [
21          {
22            "type": "string"
23          },
24          {
25            "type": "array",
26            "minItems": 3,
27            "maxItems": 3,
28            "items": {
29              "type": "integer",
30              "minimum": 0,
31              "maximum": 255
32            }
33          },
34          {
35            "type": "array",
36            "minItems": 4,
37            "maxItems": 4,
38            "items": {
39              "type": "number"
40            }
41          }
42        ]
43      },
44      {
45        "id": "ThemeExperiment",
46        "type": "object",
47        "properties": {
48          "stylesheet": {
49            "optional": true,
50            "$ref": "ExtensionURL"
51          },
52          "images": {
53            "type": "object",
54            "optional": true,
55            "additionalProperties": {
56              "type": "string"
57            }
58          },
59          "colors": {
60            "type": "object",
61            "optional": true,
62            "additionalProperties": {
63              "type": "string"
64            }
65          },
66          "properties": {
67            "type": "object",
68            "optional": true,
69            "additionalProperties": {
70              "type": "string"
71            }
72          }
73        }
74      },
75      {
76        "id": "ThemeType",
77        "type": "object",
78        "properties": {
79          "images": {
80            "type": "object",
81            "optional": true,
82            "properties": {
83              "additional_backgrounds": {
84                "type": "array",
85                "items": { "$ref": "ImageDataOrExtensionURL" },
86                "maxItems": 15,
87                "optional": true
88              },
89              "headerURL": {
90                "$ref": "ImageDataOrExtensionURL",
91                "optional": true,
92                "deprecated": "Unsupported images property, use 'theme.images.theme_frame', this alias is ignored in Firefox >= 70."
93              },
94              "theme_frame": {
95                "$ref": "ImageDataOrExtensionURL",
96                "optional": true
97              }
98            },
99            "additionalProperties": { "$ref": "ImageDataOrExtensionURL" }
100          },
101          "colors": {
102            "type": "object",
103            "optional": true,
104            "properties": {
105              "tab_selected": {
106                "$ref": "ThemeColor",
107                "optional": true
108              },
109              "accentcolor": {
110                "$ref": "ThemeColor",
111                "optional": true,
112                "deprecated": "Unsupported colors property, use 'theme.colors.frame', this alias is ignored in Firefox >= 70."
113              },
114              "frame": {
115                "$ref": "ThemeColor",
116                "optional": true
117              },
118              "frame_inactive": {
119                "$ref": "ThemeColor",
120                "optional": true
121              },
122              "textcolor": {
123                "$ref": "ThemeColor",
124                "optional": true,
125                "deprecated": "Unsupported color property, use 'theme.colors.tab_background_text', this alias is ignored in Firefox >= 70."
126              },
127              "tab_background_text": {
128                "$ref": "ThemeColor",
129                "optional": true
130              },
131              "tab_background_separator": {
132                "$ref": "ThemeColor",
133                "optional": true
134              },
135              "tab_loading": {
136                "$ref": "ThemeColor",
137                "optional": true
138              },
139              "tab_text": {
140                "$ref": "ThemeColor",
141                "optional": true
142              },
143              "tab_line": {
144                "$ref": "ThemeColor",
145                "optional": true
146              },
147              "toolbar": {
148                "$ref": "ThemeColor",
149                "optional": true
150              },
151              "toolbar_text": {
152                "$ref": "ThemeColor",
153                "optional": true,
154                 "description": "This color property is an alias of 'bookmark_text'."
155              },
156              "bookmark_text": {
157                "$ref": "ThemeColor",
158                "optional": true
159              },
160              "toolbar_field": {
161                "$ref": "ThemeColor",
162                "optional": true
163              },
164              "toolbar_field_text": {
165                "$ref": "ThemeColor",
166                "optional": true
167              },
168              "toolbar_field_border": {
169                "$ref": "ThemeColor",
170                "optional": true
171              },
172              "toolbar_field_separator": {
173                "$ref": "ThemeColor",
174                "optional": true,
175                "deprecated": "This color property is ignored in Firefox >= 89."
176              },
177              "toolbar_top_separator": {
178                "$ref": "ThemeColor",
179                "optional": true
180              },
181              "toolbar_bottom_separator": {
182                "$ref": "ThemeColor",
183                "optional": true
184              },
185              "toolbar_vertical_separator": {
186                "$ref": "ThemeColor",
187                "optional": true
188              },
189              "icons": {
190                "$ref": "ThemeColor",
191                "optional": true
192              },
193              "icons_attention": {
194                "$ref": "ThemeColor",
195                "optional": true
196              },
197              "button_background_hover": {
198               "$ref": "ThemeColor",
199               "optional": true
200              },
201              "button_background_active": {
202                "$ref": "ThemeColor",
203                "optional": true
204              },
205              "popup": {
206                "$ref": "ThemeColor",
207                "optional": true
208              },
209              "popup_text": {
210                "$ref": "ThemeColor",
211                "optional": true
212              },
213              "popup_border": {
214                "$ref": "ThemeColor",
215                "optional": true
216              },
217              "toolbar_field_focus": {
218                "$ref": "ThemeColor",
219                "optional": true
220              },
221              "toolbar_field_text_focus": {
222                "$ref": "ThemeColor",
223                "optional": true
224              },
225              "toolbar_field_border_focus": {
226                "$ref": "ThemeColor",
227                "optional": true
228              },
229              "popup_highlight": {
230                "$ref": "ThemeColor",
231                "optional": true
232              },
233              "popup_highlight_text": {
234                "$ref": "ThemeColor",
235                "optional": true
236              },
237              "ntp_background": {
238                "$ref": "ThemeColor",
239                "optional": true
240              },
241              "ntp_card_background": {
242                "$ref": "ThemeColor",
243                "optional": true
244              },
245              "ntp_text": {
246                "$ref": "ThemeColor",
247                "optional": true
248              },
249              "sidebar": {
250                "$ref": "ThemeColor",
251                "optional": true
252              },
253              "sidebar_border": {
254                "$ref": "ThemeColor",
255                "optional": true
256              },
257              "sidebar_text": {
258                "$ref": "ThemeColor",
259                "optional": true
260              },
261              "sidebar_highlight": {
262                "$ref": "ThemeColor",
263                "optional": true
264              },
265              "sidebar_highlight_text": {
266                "$ref": "ThemeColor",
267                "optional": true
268              },
269			        "toolbar_field_highlight": {
270                "$ref": "ThemeColor",
271                "optional": true
272              },
273              "toolbar_field_highlight_text": {
274                "$ref": "ThemeColor",
275                "optional": true
276              }
277            },
278            "additionalProperties": { "$ref": "ThemeColor" }
279          },
280          "properties": {
281            "type": "object",
282            "optional": true,
283            "properties": {
284              "additional_backgrounds_alignment": {
285                "type": "array",
286                "items": {
287                  "type": "string",
288                  "enum": [
289                    "bottom", "center", "left", "right", "top",
290                    "center bottom", "center center", "center top",
291                    "left bottom", "left center", "left top",
292                    "right bottom", "right center", "right top"
293                  ]
294                },
295                "maxItems": 15,
296                "optional": true
297              },
298              "additional_backgrounds_tiling": {
299                "type": "array",
300                "items": {
301                  "type": "string",
302                  "enum": ["no-repeat", "repeat", "repeat-x", "repeat-y"]
303                },
304                "maxItems": 15,
305                "optional": true
306              }
307            },
308            "additionalProperties": { "type": "string" }
309          }
310        },
311        "additionalProperties": { "$ref": "UnrecognizedProperty" }
312      },
313      {
314        "id": "ThemeManifest",
315        "type": "object",
316        "description": "Contents of manifest.json for a static theme",
317        "$import": "manifest.ManifestBase",
318        "properties": {
319          "theme": {
320            "$ref": "ThemeType"
321          },
322          "dark_theme": {
323            "$ref": "ThemeType",
324            "optional": true
325          },
326          "default_locale": {
327            "type": "string",
328            "optional": true
329          },
330          "theme_experiment": {
331            "$ref": "ThemeExperiment",
332            "optional": true
333          },
334          "icons": {
335            "type": "object",
336            "optional": true,
337            "patternProperties": {
338              "^[1-9]\\d*$": { "type": "string" }
339            }
340          }
341        }
342      },
343      {
344        "$extend": "WebExtensionManifest",
345        "properties": {
346          "theme_experiment": {
347            "$ref": "ThemeExperiment",
348            "optional": true
349          }
350        }
351      }
352    ]
353  },
354  {
355    "namespace": "theme",
356    "description": "The theme API allows customizing of visual elements of the browser.",
357    "types": [
358      {
359        "id": "ThemeUpdateInfo",
360        "type": "object",
361        "description": "Info provided in the onUpdated listener.",
362        "properties": {
363          "theme": {
364            "type": "object",
365            "description": "The new theme after update"
366          },
367          "windowId": {
368            "type": "integer",
369            "description": "The id of the window the theme has been applied to",
370            "optional": true
371          }
372        }
373      }
374    ],
375    "events": [
376      {
377        "name": "onUpdated",
378        "type": "function",
379        "description": "Fired when a new theme has been applied",
380        "parameters": [
381          {
382            "$ref": "ThemeUpdateInfo",
383            "name": "updateInfo",
384            "description": "Details of the theme update"
385          }
386        ]
387      }
388    ],
389    "functions": [
390      {
391        "name": "getCurrent",
392        "type": "function",
393        "async": true,
394        "description": "Returns the current theme for the specified window or the last focused window.",
395        "parameters": [
396          {
397            "type": "integer",
398            "name": "windowId",
399            "optional": true,
400            "description": "The window for which we want the theme."
401          }
402        ]
403      },
404      {
405        "name": "update",
406        "type": "function",
407        "async": true,
408        "description": "Make complete updates to the theme. Resolves when the update has completed.",
409        "permissions": ["theme"],
410        "parameters": [
411          {
412            "type": "integer",
413            "name": "windowId",
414            "optional": true,
415            "description": "The id of the window to update. No id updates all windows."
416          },
417          {
418            "name": "details",
419            "$ref": "manifest.ThemeType",
420            "description": "The properties of the theme to update."
421          }
422        ]
423      },
424      {
425        "name": "reset",
426        "type": "function",
427        "async": true,
428        "description": "Removes the updates made to the theme.",
429        "permissions": ["theme"],
430        "parameters": [
431          {
432            "type": "integer",
433            "name": "windowId",
434            "optional": true,
435            "description": "The id of the window to reset. No id resets all windows."
436          }
437        ]
438      }
439    ]
440  }
441]
442