Type | Object |
---|---|
Mandatory | No |
Example |
"theme": { "images": { "headerURL": "images/sun.jpg" }, "colors": { "accentcolor": "#CF723F", "textcolor": "#000" } } |
Use the theme key to define a static theme to apply to Firefox.
If your manifest.json file includes the theme key, the extension is assumed to be a theme and any other WebExtension keys are ignored. If you want to include a theme with an extension, please see the theme
API.
Image formats
The following image formats are supported in all theme image properties:
- JPEG
- PNG
- APNG
- SVG
- GIF (animated GIF isn’t supported)
Syntax
The theme key is an object that takes the following properties:
Name | Type | Description |
---|---|---|
images |
Object |
Mandatory. Has the following properties:
All URLs are relative to the manifest.json file and cannot reference an external URL. Images should be 200 pixels high to ensure they always fill the header space vertically. |
colors |
Object |
Mandatory. Has the following properties:
|
properties |
Object |
Optional This object has two properties that affect how the
|
Examples
A basic theme must define an image to add to the header, the accent color to use in the header, and the color of text used in the header:
"theme": { "images": { "headerURL": "images/sun.jpg" }, "colors": { "accentcolor": "#CF723F", "textcolor": "#000" } }
Multiple images can be used to fill the header, using a blank/transparent header image to gain control over the placement of each visible image:
"theme": { "images": { "headerURL": "images/blank.png", "additional_backgrounds": [ "images/left.png" , "images/middle.png", "images/right.png"] }, "properties": { "additional_backgrounds_alignment": [ "left top" , "top", "right top"] }, "colors": { "accentcolor": "blue", "textcolor": "#ffffff" } }
You can also fill the header with a repeating image, or images, in this case a single image anchored in the middle top of the header and repeated across the rest of the header:
"theme": { "images": { "headerURL": "images/blank.png", "additional_backgrounds": [ "images/logo.png"] }, "properties": { "additional_backgrounds_alignment": [ "top" ], "additional_backgrounds_tiling": [ "repeat" ] }, "colors": { "accentcolor": "green", "textcolor": "#000" } }
Browser compatibility
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Chrome | Edge | Firefox | Firefox for Android | Opera | |
---|---|---|---|---|---|
Basic support | Yes | No | 55 | No | No |
Chrome compatibility
Firefox property | Chrome property | Notes |
---|---|---|
images/headerURL |
images/frame_frame |
In Chrome, the image is anchored to the top left of the header and tiled if it doesn’t fill the header area. |
images/additional_backgrounds |
Not supported | |
colors/accentcolor |
colors/frame |
colors/frame only supports RGB color definition. |
colors/textcolor |
colors/tab_text |
colors/frame only supports RGB color definition. |
properties/additional_backgrounds_alignment |
Not supported | |
properties/additional_backgrounds_tiling |
Not supported |