Revision control
Copy as Markdown
Other Tools
[
{
"namespace": "manifest",
"types": [
{
"$extend": "WebExtensionManifest",
"properties": {
"action": {
"min_manifest_version": 3,
"type": "object",
"additionalProperties": {
"$ref": "UnrecognizedProperty"
},
"properties": {
"default_label": {
"type": "string",
"description": "The label of the action button, defaults to its title. Can be set to an empty string to not display any label. If the containing toolbar is configured to display text only, the title will be used as fallback.",
"optional": true,
"preprocess": "localize"
},
"default_title": {
"type": "string",
"description": "The title of the action button. This shows up in the tooltip and the label. Defaults to the add-on name.",
"optional": true,
"preprocess": "localize"
},
"default_icon": {
"$ref": "manifest.IconPath",
"description": "The paths to one or more icons for the action button.",
"optional": true
},
"theme_icons": {
"type": "array",
"optional": true,
"minItems": 1,
"items": {
"$ref": "ThemeIcons"
},
"description": "Specifies dark and light icons to be used with themes. The <var>light</var> icon is used on dark backgrounds and vice versa. **Note:** The default theme uses the <var>default_icon</var> for light backgrounds (if specified)."
},
"default_popup": {
"type": "string",
"format": "relativeUrl",
"optional": true,
"description": "The html document to be opened as a popup when the user clicks on the action button. Ignored for action buttons with type <var>menu</var>.",
"preprocess": "localize"
},
"browser_style": {
"type": "boolean",
"optional": true,
"description": "Enable browser styles. See the <a href='url-mdn-browser-styles'>MDN documentation on browser styles</a> for more information.",
"default": false
},
"default_area": {
"type": "string",
"optional": true,
"description": "Defines the location the action button will appear. Deprecated and ignored. Replaced by <var>allowed_spaces</var>",
"deprecated": "Unsupported on Thunderbird."
},
"default_windows": {
"description": "Defines the windows, the action button should appear in. Defaults to showing it only in the <var>normal</var> Thunderbird window, but can also be shown in the <var>messageDisplay</var> window.",
"type": "array",
"items": {
"type": "string",
"enum": ["normal", "messageDisplay"]
},
"default": ["normal"],
"optional": true
},
"allowed_spaces": {
"description": "Defines for which spaces the action button will be added to Thunderbird's unified toolbar. Defaults to only allowing the action in the <var>mail</var> space. The <var>default</var> space is for tabs that don't belong to any space. If this is an empty array, the action button is shown in all spaces.",
"type": "array",
"items": {
"type": "string",
"enum": [
"mail",
"addressbook",
"calendar",
"tasks",
"chat",
"settings",
"default"
]
},
"default": ["mail"],
"optional": true
},
"type": {
"description": "Specifies the type of the button. Default type is <var>button</var>.",
"type": "string",
"enum": ["button", "menu"],
"optional": true,
"default": "button"
}
},
"optional": true
}
}
},
{
"$extend": "WebExtensionManifest",
"properties": {
"browser_action": {
"max_manifest_version": 2,
"type": "object",
"additionalProperties": {
"$ref": "UnrecognizedProperty"
},
"properties": {
"default_label": {
"type": "string",
"description": "The label of the browserAction button, defaults to its title. Can be set to an empty string to not display any label. If the containing toolbar is configured to display text only, the title will be used as fallback.",
"optional": true,
"preprocess": "localize"
},
"default_title": {
"type": "string",
"description": "The title of the browserAction button. This shows up in the tooltip and the label. Defaults to the add-on name.",
"optional": true,
"preprocess": "localize"
},
"default_icon": {
"$ref": "manifest.IconPath",
"description": "The paths to one or more icons for the browserAction button.",
"optional": true
},
"theme_icons": {
"type": "array",
"optional": true,
"minItems": 1,
"items": {
"$ref": "ThemeIcons"
},
"description": "Specifies dark and light icons to be used with themes. The <var>light</var> icon is used on dark backgrounds and vice versa. **Note:** The default theme uses the <var>default_icon</var> for light backgrounds (if specified)."
},
"default_popup": {
"type": "string",
"format": "relativeUrl",
"optional": true,
"description": "The html document to be opened as a popup when the user clicks on the browserAction button. Ignored for action buttons with type <var>menu</var>.",
"preprocess": "localize"
},
"browser_style": {
"type": "boolean",
"optional": true,
"description": "Enable browser styles. See the <a href='url-mdn-browser-styles'>MDN documentation on browser styles</a> for more information.",
"default": false
},
"default_area": {
"description": "Defines the location the browserAction button will appear. Deprecated and ignored. Replaced by <var>allowed_spaces</var>",
"type": "string",
"enum": ["maintoolbar", "tabstoolbar"],
"optional": true
},
"default_windows": {
"description": "Defines the windows, the browserAction button should appear in. Defaults to showing it only in the <var>normal</var> Thunderbird window, but can also be shown in the <var>messageDisplay</var> window.",
"type": "array",
"items": {
"type": "string",
"enum": ["normal", "messageDisplay"]
},
"default": ["normal"],
"optional": true
},
"allowed_spaces": {
"description": "Defines for which spaces the browserAction button will be added to Thunderbird's unified toolbar. Defaults to only allowing the browserAction in the <var>mail</var> space. The <var>default</var> space is for tabs that don't belong to any space. If this is an empty array, the browserAction button is shown in all spaces.",
"type": "array",
"items": {
"type": "string",
"enum": [
"mail",
"addressbook",
"calendar",
"tasks",
"chat",
"settings",
"default"
]
},
"default": ["mail"],
"optional": true
},
"type": {
"description": "Specifies the type of the button. Default type is <var>button</var>.",
"type": "string",
"enum": ["button", "menu"],
"optional": true,
"default": "button"
}
},
"optional": true
}
}
}
]
},
{
"namespace": "action",
"description": "Use the action API to add a button to Thunderbird's unified toolbar. In addition to its icon, an action button can also have a tooltip, a badge, and a popup.",
"permissions": ["manifest:action", "manifest:browser_action"],
"min_manifest_version": 3,
"types": [
{
"id": "ColorArray",
"description": "An array of four integers in the range [0,255] that make up the RGBA color. For example, opaque red is <var>[255, 0, 0, 255]</var>.",
"type": "array",
"items": {
"type": "integer",
"minimum": 0,
"maximum": 255
},
"minItems": 4,
"maxItems": 4
},
{
"id": "ImageDataType",
"type": "object",
"isInstanceOf": "ImageData",
"additionalProperties": {
"type": "any"
},
"postprocess": "convertImageDataToURL",
"description": "Pixel data for an image. Must be an <a href='url-image-data'>ImageData</a> object (for example, from a <a href='url-canvas-element'>canvas</a> element)."
},
{
"id": "ImageDataDictionary",
"type": "object",
"description": "A <em>dictionary object</em> to specify multiple <a href='url-image-data'>ImageData</a> objects in different sizes, so the icon does not have to be scaled for a device with a different pixel density. Each entry is a <em>name-value</em> pair with <em>value</em> being an <a href='url-image-data'>ImageData</a> object, and <em>name</em> its size. Example: <literalinclude>includes/ImageDataDictionary.json<lang>JavaScript</lang></literalinclude>See the <a href='url-mdn-icon-size'>MDN documentation about choosing icon sizes</a> for more information on this.",
"patternProperties": {
"^[1-9]\\d*$": {
"$ref": "ImageDataType"
}
}
},
{
"id": "OnClickData",
"type": "object",
"description": "Information sent when an action button is clicked.",
"properties": {
"modifiers": {
"type": "array",
"items": {
"type": "string",
"enum": ["Shift", "Alt", "Command", "Ctrl", "MacCtrl"]
},
"description": "An array of keyboard modifiers that were held while the menu item was clicked."
},
"button": {
"type": "integer",
"optional": true,
"description": "An integer value of button by which menu item was clicked."
}
}
}
],
"functions": [
{
"name": "setTitle",
"type": "function",
"description": "Sets the title of the action button. Is used as tooltip and as the label.",
"async": "callback",
"parameters": [
{
"name": "details",
"type": "object",
"properties": {
"title": {
"choices": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "A string the action button should display as its label and when moused over. Cleared by setting it to <var>null</var> or an empty string (title defined the manifest will be used)."
},
"tabId": {
"type": "integer",
"optional": true,
"minimum": 0,
"description": "Sets the title only for the given tab."
},
"windowId": {
"type": "integer",
"optional": true,
"minimum": -2,
"unsupported": true,
"description": "Will throw an error if used."
}
}
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": []
}
]
},
{
"name": "getTitle",
"type": "function",
"description": "Gets the title of the action button.",
"async": "callback",
"parameters": [
{
"name": "details",
"type": "object",
"properties": {
"tabId": {
"type": "integer",
"optional": true,
"minimum": 0,
"description": "Specifies for which tab the title should be retrieved. If no tab is specified, the global value is retrieved."
},
"windowId": {
"type": "integer",
"optional": true,
"minimum": -2,
"unsupported": true,
"description": "Will throw an error if used."
}
}
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": [
{
"name": "result",
"type": "string"
}
]
}
]
},
{
"name": "setLabel",
"type": "function",
"description": "Sets the label of the action button. Can be used to set different values for the tooltip (defined by the title) and the label. Additionally, the label can be set to an empty string, not showing any label at all.",
"async": "callback",
"parameters": [
{
"name": "details",
"type": "object",
"properties": {
"label": {
"choices": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "A string the action button should use as its label, overriding the defined title. Can be set to an empty string to not display any label at all. If the containing toolbar is configured to display text only, its title will be used. Cleared by setting it to <var>null</var>."
},
"tabId": {
"type": "integer",
"optional": true,
"minimum": 0,
"description": "Sets the label only for the given tab."
},
"windowId": {
"type": "integer",
"optional": true,
"minimum": -2,
"unsupported": true,
"description": "Will throw an error if used."
}
}
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": []
}
]
},
{
"name": "getLabel",
"type": "function",
"description": "Gets the label of the action button. Returns <var>null</var>, if no label has been set and the title is used.",
"async": "callback",
"parameters": [
{
"name": "details",
"type": "object",
"properties": {
"tabId": {
"type": "integer",
"optional": true,
"minimum": 0,
"description": "Specifies for which tab the label should be retrieved. If no tab is specified, the global value is retrieved."
},
"windowId": {
"type": "integer",
"optional": true,
"minimum": -2,
"unsupported": true,
"description": "Will throw an error if used."
}
}
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": [
{
"name": "result",
"choices": [
{
"type": "string"
},
{
"type": "null"
}
]
}
]
}
]
},
{
"name": "setIcon",
"type": "function",
"description": "Sets the icon for the action button. Either the <var>path</var> or the <var>imageData</var> property must be specified.",
"async": "callback",
"parameters": [
{
"name": "details",
"type": "object",
"properties": {
"imageData": {
"choices": [
{
"$ref": "ImageDataType"
},
{
"$ref": "ImageDataDictionary"
}
],
"optional": true,
"description": "The image data for one or more icons for the action button."
},
"path": {
"$ref": "manifest.IconPath",
"optional": true,
"description": "The paths to one or more icons for the action button."
},
"tabId": {
"type": "integer",
"optional": true,
"minimum": 0,
"description": "Sets the icon only for the given tab."
},
"windowId": {
"type": "integer",
"optional": true,
"minimum": -2,
"unsupported": true,
"description": "Will throw an error if used."
}
}
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": []
}
]
},
{
"name": "setPopup",
"type": "function",
"description": "Sets the html document to be opened as a popup when the user clicks on the action button.",
"async": "callback",
"parameters": [
{
"name": "details",
"type": "object",
"properties": {
"popup": {
"choices": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "The html file to show in a popup. Can be set to an empty string to not open a popup. Cleared by setting it to <var>null</var> (popup value defined the manifest will be used)."
},
"tabId": {
"type": "integer",
"optional": true,
"minimum": 0,
"description": "Sets the popup only for the given tab."
},
"windowId": {
"type": "integer",
"optional": true,
"minimum": -2,
"unsupported": true,
"description": "Will throw an error if used."
}
}
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": []
}
]
},
{
"name": "getPopup",
"type": "function",
"description": "Gets the html document set as the popup for this action button.",
"async": "callback",
"parameters": [
{
"name": "details",
"type": "object",
"properties": {
"tabId": {
"type": "integer",
"optional": true,
"minimum": 0,
"description": "Specifies for which tab the popup document should be retrieved. If no tab is specified, the global value is retrieved."
},
"windowId": {
"type": "integer",
"optional": true,
"minimum": -2,
"unsupported": true,
"description": "Will throw an error if used."
}
}
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": [
{
"name": "result",
"type": "string"
}
]
}
]
},
{
"name": "setBadgeText",
"type": "function",
"description": "Sets the badge text for the action button. The badge is displayed on top of the icon.",
"async": "callback",
"parameters": [
{
"name": "details",
"type": "object",
"properties": {
"text": {
"choices": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Any number of characters can be passed, but only about four can fit in the space. Cleared by setting it to <var>null</var> or an empty string."
},
"tabId": {
"type": "integer",
"optional": true,
"minimum": 0,
"description": "Sets the badge text only for the given tab."
},
"windowId": {
"type": "integer",
"optional": true,
"minimum": -2,
"unsupported": true,
"description": "Will throw an error if used."
}
}
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": []
}
]
},
{
"name": "getBadgeText",
"type": "function",
"description": "Gets the badge text of the action button.",
"async": "callback",
"parameters": [
{
"name": "details",
"type": "object",
"properties": {
"tabId": {
"type": "integer",
"optional": true,
"minimum": 0,
"description": "Specifies for which tab the badge text should be retrieved. If no tab is specified, the global value is retrieved."
},
"windowId": {
"type": "integer",
"optional": true,
"minimum": -2,
"unsupported": true,
"description": "Will throw an error if used."
}
}
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": [
{
"name": "result",
"type": "string"
}
]
}
]
},
{
"name": "setBadgeTextColor",
"type": "function",
"description": "Sets the text color for the badge.",
"async": true,
"parameters": [
{
"name": "details",
"type": "object",
"properties": {
"color": {
"choices": [
{
"type": "string"
},
{
"$ref": "ColorArray"
},
{
"type": "null"
}
],
"description": "The color to use as text color in the badge. Cleared by setting it to <var>null</var>."
},
"tabId": {
"type": "integer",
"optional": true,
"minimum": 0,
"description": "Sets the text color for the badge only for the given tab."
},
"windowId": {
"type": "integer",
"optional": true,
"minimum": -2,
"unsupported": true,
"description": "Will throw an error if used."
}
}
}
]
},
{
"name": "getBadgeTextColor",
"type": "function",
"description": "Gets the text color of the badge.",
"async": "callback",
"parameters": [
{
"name": "details",
"type": "object",
"properties": {
"tabId": {
"type": "integer",
"optional": true,
"minimum": 0,
"description": "Specifies for which tab the badge text color should be retrieved. If no tab is specified, the global value is retrieved."
},
"windowId": {
"type": "integer",
"optional": true,
"minimum": -2,
"unsupported": true,
"description": "Will throw an error if used."
}
}
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": [
{
"name": "result",
"$ref": "ColorArray"
}
]
}
]
},
{
"name": "setBadgeBackgroundColor",
"type": "function",
"description": "Sets the background color for the badge.",
"async": "callback",
"parameters": [
{
"name": "details",
"type": "object",
"properties": {
"color": {
"choices": [
{
"type": "string"
},
{
"$ref": "ColorArray"
},
{
"type": "null"
}
],
"description": "The color to use as background in the badge. Cleared by setting it to <var>null</var>."
},
"tabId": {
"type": "integer",
"optional": true,
"minimum": 0,
"description": "Sets the background color for the badge only for the given tab."
},
"windowId": {
"type": "integer",
"optional": true,
"minimum": -2,
"unsupported": true,
"description": "Will throw an error if used."
}
}
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": []
}
]
},
{
"name": "getBadgeBackgroundColor",
"type": "function",
"description": "Gets the badge background color of the action button.",
"async": "callback",
"parameters": [
{
"name": "details",
"type": "object",
"properties": {
"tabId": {
"type": "integer",
"optional": true,
"minimum": 0,
"description": "Specifies for which tab the badge background color should be retrieved. If no tab is specified, the global value is retrieved."
},
"windowId": {
"type": "integer",
"optional": true,
"minimum": -2,
"unsupported": true,
"description": "Will throw an error if used."
}
}
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": [
{
"name": "result",
"$ref": "ColorArray"
}
]
}
]
},
{
"name": "enable",
"type": "function",
"description": "Enables the action button for a specific tab (if a <var>tabId</var> is provided), or for all tabs which do not have a custom enable state. Once the enable state of a tab has been updated individually, all further changes to its state have to be done individually as well. By default, an action button is enabled.",
"async": "callback",
"parameters": [
{
"type": "integer",
"optional": true,
"name": "tabId",
"minimum": 0,
"description": "The id of the tab for which you want to modify the action button."
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": []
}
]
},
{
"name": "disable",
"type": "function",
"description": "Disables the action button for a specific tab (if a <var>tabId</var> is provided), or for all tabs which do not have a custom enable state. Once the enable state of a tab has been updated individually, all further changes to its state have to be done individually as well.",
"async": "callback",
"parameters": [
{
"type": "integer",
"optional": true,
"name": "tabId",
"minimum": 0,
"description": "The id of the tab for which you want to modify the action button."
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": []
}
]
},
{
"name": "isEnabled",
"type": "function",
"description": "Checks whether the action button is enabled.",
"async": "callback",
"parameters": [
{
"name": "details",
"type": "object",
"properties": {
"tabId": {
"type": "integer",
"optional": true,
"minimum": 0,
"description": "Specifies for which tab the state should be retrieved. If no tab is specified, the global value is retrieved."
},
"windowId": {
"type": "integer",
"optional": true,
"minimum": -2,
"unsupported": true,
"description": "Will throw an error if used."
}
}
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": [
{
"type": "boolean"
}
]
}
]
},
{
"name": "openPopup",
"type": "function",
"description": "Opens the action's popup window in the specified window. Defaults to the current window. Returns false if the popup could not be opened because the action has no popup, is of type <var>menu</var>, is disabled or has been removed from the toolbar.",
"async": "callback",
"parameters": [
{
"name": "options",
"optional": true,
"type": "object",
"description": "An object with information about the popup to open.",
"properties": {
"windowId": {
"type": "integer",
"minimum": -2,
"optional": true,
"description": "Defaults to the current window."
}
}
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": [
{
"type": "boolean"
}
]
}
]
}
],
"events": [
{
"name": "onClicked",
"type": "function",
"description": "Fired when an action button is clicked. This event will not fire if the action has a popup. This is a user input event handler. For asynchronous listeners some <a href='url-user-input-restrictions'>restrictions</a> apply.",
"parameters": [
{
"name": "tab",
"$ref": "tabs.Tab"
},
{
"name": "info",
"$ref": "OnClickData",
"optional": true
}
]
}
]
},
{
"namespace": "browserAction",
"description": "Use the browserAction API to add a button to Thunderbird's unified toolbar. In addition to its icon, a browserAction button can also have a tooltip, a badge, and a popup.",
"permissions": ["manifest:action", "manifest:browser_action"],
"max_manifest_version": 2,
"$import": "action"
}
]