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_text": { 242 "$ref": "ThemeColor", 243 "optional": true 244 }, 245 "sidebar": { 246 "$ref": "ThemeColor", 247 "optional": true 248 }, 249 "sidebar_border": { 250 "$ref": "ThemeColor", 251 "optional": true 252 }, 253 "sidebar_text": { 254 "$ref": "ThemeColor", 255 "optional": true 256 }, 257 "sidebar_highlight": { 258 "$ref": "ThemeColor", 259 "optional": true 260 }, 261 "sidebar_highlight_text": { 262 "$ref": "ThemeColor", 263 "optional": true 264 }, 265 "toolbar_field_highlight": { 266 "$ref": "ThemeColor", 267 "optional": true 268 }, 269 "toolbar_field_highlight_text": { 270 "$ref": "ThemeColor", 271 "optional": true 272 } 273 }, 274 "additionalProperties": { "$ref": "ThemeColor" } 275 }, 276 "properties": { 277 "type": "object", 278 "optional": true, 279 "properties": { 280 "additional_backgrounds_alignment": { 281 "type": "array", 282 "items": { 283 "type": "string", 284 "enum": [ 285 "bottom", "center", "left", "right", "top", 286 "center bottom", "center center", "center top", 287 "left bottom", "left center", "left top", 288 "right bottom", "right center", "right top" 289 ] 290 }, 291 "maxItems": 15, 292 "optional": true 293 }, 294 "additional_backgrounds_tiling": { 295 "type": "array", 296 "items": { 297 "type": "string", 298 "enum": ["no-repeat", "repeat", "repeat-x", "repeat-y"] 299 }, 300 "maxItems": 15, 301 "optional": true 302 } 303 }, 304 "additionalProperties": { "type": "string" } 305 } 306 }, 307 "additionalProperties": { "$ref": "UnrecognizedProperty" } 308 }, 309 { 310 "id": "ThemeManifest", 311 "type": "object", 312 "description": "Contents of manifest.json for a static theme", 313 "$import": "manifest.ManifestBase", 314 "properties": { 315 "theme": { 316 "$ref": "ThemeType" 317 }, 318 "dark_theme": { 319 "$ref": "ThemeType", 320 "optional": true 321 }, 322 "default_locale": { 323 "type": "string", 324 "optional": true 325 }, 326 "theme_experiment": { 327 "$ref": "ThemeExperiment", 328 "optional": true 329 }, 330 "icons": { 331 "type": "object", 332 "optional": true, 333 "patternProperties": { 334 "^[1-9]\\d*$": { "type": "string" } 335 } 336 } 337 } 338 }, 339 { 340 "$extend": "WebExtensionManifest", 341 "properties": { 342 "theme_experiment": { 343 "$ref": "ThemeExperiment", 344 "optional": true 345 } 346 } 347 } 348 ] 349 }, 350 { 351 "namespace": "theme", 352 "description": "The theme API allows customizing of visual elements of the browser.", 353 "types": [ 354 { 355 "id": "ThemeUpdateInfo", 356 "type": "object", 357 "description": "Info provided in the onUpdated listener.", 358 "properties": { 359 "theme": { 360 "type": "object", 361 "description": "The new theme after update" 362 }, 363 "windowId": { 364 "type": "integer", 365 "description": "The id of the window the theme has been applied to", 366 "optional": true 367 } 368 } 369 } 370 ], 371 "events": [ 372 { 373 "name": "onUpdated", 374 "type": "function", 375 "description": "Fired when a new theme has been applied", 376 "parameters": [ 377 { 378 "$ref": "ThemeUpdateInfo", 379 "name": "updateInfo", 380 "description": "Details of the theme update" 381 } 382 ] 383 } 384 ], 385 "functions": [ 386 { 387 "name": "getCurrent", 388 "type": "function", 389 "async": true, 390 "description": "Returns the current theme for the specified window or the last focused window.", 391 "parameters": [ 392 { 393 "type": "integer", 394 "name": "windowId", 395 "optional": true, 396 "description": "The window for which we want the theme." 397 } 398 ] 399 }, 400 { 401 "name": "update", 402 "type": "function", 403 "async": true, 404 "description": "Make complete updates to the theme. Resolves when the update has completed.", 405 "permissions": ["theme"], 406 "parameters": [ 407 { 408 "type": "integer", 409 "name": "windowId", 410 "optional": true, 411 "description": "The id of the window to update. No id updates all windows." 412 }, 413 { 414 "name": "details", 415 "$ref": "manifest.ThemeType", 416 "description": "The properties of the theme to update." 417 } 418 ] 419 }, 420 { 421 "name": "reset", 422 "type": "function", 423 "async": true, 424 "description": "Removes the updates made to the theme.", 425 "permissions": ["theme"], 426 "parameters": [ 427 { 428 "type": "integer", 429 "name": "windowId", 430 "optional": true, 431 "description": "The id of the window to reset. No id resets all windows." 432 } 433 ] 434 } 435 ] 436 } 437] 438