summaryrefslogtreecommitdiffstats
path: root/comm/mail/components/extensions/schemas
diff options
context:
space:
mode:
Diffstat (limited to 'comm/mail/components/extensions/schemas')
-rw-r--r--comm/mail/components/extensions/schemas/LICENSE27
-rw-r--r--comm/mail/components/extensions/schemas/accounts.json235
-rw-r--r--comm/mail/components/extensions/schemas/addressBook.json977
-rw-r--r--comm/mail/components/extensions/schemas/browserAction.json848
-rw-r--r--comm/mail/components/extensions/schemas/chrome_settings_overrides.json194
-rw-r--r--comm/mail/components/extensions/schemas/cloudFile.json501
-rw-r--r--comm/mail/components/extensions/schemas/commands.json279
-rw-r--r--comm/mail/components/extensions/schemas/compose.json937
-rw-r--r--comm/mail/components/extensions/schemas/composeAction.json722
-rw-r--r--comm/mail/components/extensions/schemas/extensionScripts.json133
-rw-r--r--comm/mail/components/extensions/schemas/folders.json408
-rw-r--r--comm/mail/components/extensions/schemas/identities.json277
-rw-r--r--comm/mail/components/extensions/schemas/mailTabs.json428
-rw-r--r--comm/mail/components/extensions/schemas/menus.json757
-rw-r--r--comm/mail/components/extensions/schemas/menus_child.json31
-rw-r--r--comm/mail/components/extensions/schemas/messageDisplay.json159
-rw-r--r--comm/mail/components/extensions/schemas/messageDisplayAction.json721
-rw-r--r--comm/mail/components/extensions/schemas/messages.json933
-rw-r--r--comm/mail/components/extensions/schemas/sessions.json76
-rw-r--r--comm/mail/components/extensions/schemas/spaces.json290
-rw-r--r--comm/mail/components/extensions/schemas/spacesToolbar.json175
-rw-r--r--comm/mail/components/extensions/schemas/tabs.json989
-rw-r--r--comm/mail/components/extensions/schemas/theme.json542
-rw-r--r--comm/mail/components/extensions/schemas/windows.json511
24 files changed, 11150 insertions, 0 deletions
diff --git a/comm/mail/components/extensions/schemas/LICENSE b/comm/mail/components/extensions/schemas/LICENSE
new file mode 100644
index 0000000000..9314092fdc
--- /dev/null
+++ b/comm/mail/components/extensions/schemas/LICENSE
@@ -0,0 +1,27 @@
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/comm/mail/components/extensions/schemas/accounts.json b/comm/mail/components/extensions/schemas/accounts.json
new file mode 100644
index 0000000000..fb325425b2
--- /dev/null
+++ b/comm/mail/components/extensions/schemas/accounts.json
@@ -0,0 +1,235 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "OptionalPermission",
+ "choices": [
+ {
+ "type": "string",
+ "enum": ["accountsRead"]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "namespace": "accounts",
+ "permissions": ["accountsRead"],
+ "types": [
+ {
+ "id": "MailAccount",
+ "description": "An object describing a mail account, as returned for example by the :ref:`accounts.list` and :ref:`accounts.get` methods. The ``folders`` property is only included if requested.",
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "A unique identifier for this account."
+ },
+ "name": {
+ "type": "string",
+ "description": "The human-friendly name of this account."
+ },
+ "type": {
+ "type": "string",
+ "description": "What sort of account this is, e.g. <value>imap</value>, <value>nntp</value>, or <value>pop3</value>."
+ },
+ "folders": {
+ "type": "array",
+ "optional": true,
+ "description": "The folders for this account are only included if requested.",
+ "items": {
+ "$ref": "folders.MailFolder"
+ }
+ },
+ "identities": {
+ "type": "array",
+ "description": "The identities associated with this account. The default identity is listed first, others in no particular order.",
+ "items": {
+ "$ref": "identities.MailIdentity"
+ }
+ }
+ }
+ }
+ ],
+ "functions": [
+ {
+ "name": "list",
+ "type": "function",
+ "description": "Returns all mail accounts. They will be returned in the same order as used in Thunderbird's folder pane.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "includeFolders",
+ "description": "Specifies whether the returned :ref:`accounts.MailAccount` objects should included their account's folders. Defaults to <value>true</value>.",
+ "optional": true,
+ "default": true,
+ "type": "boolean"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "accounts.MailAccount"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "get",
+ "type": "function",
+ "description": "Returns details of the requested account, or <value>null</value> if it doesn't exist.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "accountId",
+ "type": "string"
+ },
+ {
+ "name": "includeFolders",
+ "description": "Specifies whether the returned :ref:`accounts.MailAccount` object should included the account's folders. Defaults to <value>true</value>.",
+ "optional": true,
+ "default": true,
+ "type": "boolean"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "$ref": "accounts.MailAccount",
+ "optional": true
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getDefault",
+ "type": "function",
+ "description": "Returns the default account, or <value>null</value> if it is not defined.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "includeFolders",
+ "description": "Specifies whether the returned :ref:`accounts.MailAccount` object should included the account's folders. Defaults to <value>true</value>.",
+ "optional": true,
+ "default": true,
+ "type": "boolean"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "$ref": "accounts.MailAccount",
+ "optional": true
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "setDefaultIdentity",
+ "type": "function",
+ "description": "Sets the default identity for an account.",
+ "async": true,
+ "deprecated": "This will be removed. Use :ref:`identities.setDefault` instead.",
+ "parameters": [
+ {
+ "name": "accountId",
+ "type": "string"
+ },
+ {
+ "name": "identityId",
+ "type": "string"
+ }
+ ]
+ },
+ {
+ "name": "getDefaultIdentity",
+ "type": "function",
+ "description": "Returns the default identity for an account, or <value>null</value> if it is not defined.",
+ "async": "callback",
+ "deprecated": "This will be removed. Use :ref:`identities.getDefault` instead.",
+ "parameters": [
+ {
+ "name": "accountId",
+ "type": "string"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "$ref": "identities.MailIdentity"
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "events": [
+ {
+ "name": "onCreated",
+ "type": "function",
+ "description": "Fired when a new account has been created.",
+ "parameters": [
+ {
+ "name": "id",
+ "type": "string"
+ },
+ {
+ "name": "account",
+ "$ref": "MailAccount"
+ }
+ ]
+ },
+ {
+ "name": "onDeleted",
+ "type": "function",
+ "description": "Fired when an account has been removed.",
+ "parameters": [
+ {
+ "name": "id",
+ "type": "string"
+ }
+ ]
+ },
+ {
+ "name": "onUpdated",
+ "type": "function",
+ "description": "Fired when a property of an account has been modified. Folders and identities of accounts are not monitored by this event, use the dedicated folder and identity events instead. A changed ``defaultIdentity`` is reported only after a different identity has been assigned as default identity, but not after a property of the default identity has been changed.",
+ "parameters": [
+ {
+ "name": "id",
+ "type": "string"
+ },
+ {
+ "name": "changedValues",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The human-friendly name of this account."
+ },
+ "defaultIdentity": {
+ "$ref": "identities.MailIdentity",
+ "description": "The default identity of this account."
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/comm/mail/components/extensions/schemas/addressBook.json b/comm/mail/components/extensions/schemas/addressBook.json
new file mode 100644
index 0000000000..40b0b477fc
--- /dev/null
+++ b/comm/mail/components/extensions/schemas/addressBook.json
@@ -0,0 +1,977 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "OptionalPermission",
+ "choices": [
+ {
+ "type": "string",
+ "enum": ["addressBooks", "sensitiveDataUpload"]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "namespace": "addressBooks",
+ "permissions": ["addressBooks"],
+ "types": [
+ {
+ "id": "NodeType",
+ "type": "string",
+ "enum": ["addressBook", "contact", "mailingList"],
+ "description": "Indicates the type of a Node."
+ },
+ {
+ "id": "AddressBookNode",
+ "type": "object",
+ "description": "A node representing an address book.",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique identifier for the node. IDs are unique within the current profile, and they remain valid even after the program is restarted."
+ },
+ "parentId": {
+ "type": "string",
+ "optional": true,
+ "description": "The ``id`` of the parent object."
+ },
+ "type": {
+ "$ref": "NodeType",
+ "description": "Always set to <value>addressBook</value>."
+ },
+ "readOnly": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Indicates if the object is read-only."
+ },
+ "remote": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Indicates if the address book is accessed via remote look-up."
+ },
+ "name": {
+ "type": "string"
+ },
+ "contacts": {
+ "type": "array",
+ "optional": true,
+ "items": {
+ "$ref": "contacts.ContactNode"
+ },
+ "description": "A list of contacts held by this node's address book or mailing list."
+ },
+ "mailingLists": {
+ "type": "array",
+ "optional": true,
+ "items": {
+ "$ref": "mailingLists.MailingListNode"
+ },
+ "description": "A list of mailingLists in this node's address book."
+ }
+ }
+ }
+ ],
+ "functions": [
+ {
+ "name": "openUI",
+ "type": "function",
+ "async": "callback",
+ "description": "Opens the address book user interface.",
+ "parameters": [
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "return",
+ "$ref": "tabs.Tab"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "closeUI",
+ "type": "function",
+ "async": true,
+ "description": "Closes the address book user interface.",
+ "parameters": []
+ },
+ {
+ "name": "list",
+ "type": "function",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "complete",
+ "type": "boolean",
+ "optional": true,
+ "default": false,
+ "description": "If set to true, results will include contacts and mailing lists for each address book."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "AddressBookNode"
+ }
+ }
+ ]
+ }
+ ],
+ "description": "Gets a list of the user's address books, optionally including all contacts and mailing lists."
+ },
+ {
+ "name": "get",
+ "type": "function",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "id",
+ "type": "string"
+ },
+ {
+ "name": "complete",
+ "type": "boolean",
+ "optional": true,
+ "default": false,
+ "description": "If set to true, results will include contacts and mailing lists for this address book."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "$ref": "AddressBookNode"
+ }
+ ]
+ }
+ ],
+ "description": "Gets a single address book, optionally including all contacts and mailing lists."
+ },
+ {
+ "name": "create",
+ "type": "function",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "properties",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "type": "string",
+ "description": "The id of the new address book."
+ }
+ ]
+ }
+ ],
+ "description": "Creates a new, empty address book."
+ },
+ {
+ "name": "update",
+ "type": "function",
+ "async": true,
+ "parameters": [
+ {
+ "name": "id",
+ "type": "string"
+ },
+ {
+ "name": "properties",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ }
+ }
+ }
+ ],
+ "description": "Renames an address book."
+ },
+ {
+ "name": "delete",
+ "type": "function",
+ "async": true,
+ "parameters": [
+ {
+ "name": "id",
+ "type": "string"
+ }
+ ],
+ "description": "Removes an address book, and all associated contacts and mailing lists."
+ }
+ ],
+ "events": [
+ {
+ "name": "onCreated",
+ "type": "function",
+ "description": "Fired when an address book is created.",
+ "parameters": [
+ {
+ "name": "node",
+ "$ref": "AddressBookNode"
+ }
+ ]
+ },
+ {
+ "name": "onUpdated",
+ "type": "function",
+ "description": "Fired when an address book is renamed.",
+ "parameters": [
+ {
+ "name": "node",
+ "$ref": "AddressBookNode"
+ }
+ ]
+ },
+ {
+ "name": "onDeleted",
+ "type": "function",
+ "description": "Fired when an addressBook is deleted.",
+ "parameters": [
+ {
+ "name": "id",
+ "type": "string"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "namespace": "addressBooks.provider",
+ "permissions": ["addressBooks"],
+ "events": [
+ {
+ "name": "onSearchRequest",
+ "type": "function",
+ "description": "Registering this listener will create and list a read-only address book in Thunderbird's address book window, similar to LDAP address books. When selecting this address book, users will first see no contacts, but they can search for them, which will fire this event. Contacts returned by the listener callback will be displayed as contact cards in the address book. Several listeners can be registered, to create multiple address books.\n\nThe event also fires for each registered listener (for each created read-only address book), when users type something into the mail composer's <em>To:</em> field, or into similar fields like the calendar meeting attendees field. Contacts returned by the listener callback will be added to the autocomplete results in the dropdown of that field.\n\nExample: <literalinclude>includes/addressBooks/onSearchRequest.js<lang>JavaScript</lang></literalinclude>",
+ "parameters": [
+ {
+ "name": "node",
+ "$ref": "AddressBookNode"
+ },
+ {
+ "name": "searchString",
+ "description": "The search text that the user entered. Not available when invoked from the advanced address book search dialog.",
+ "type": "string",
+ "optional": true
+ },
+ {
+ "name": "query",
+ "type": "string",
+ "description": "The boolean query expression corresponding to the search. **Note:** This parameter may change in future releases of Thunderbird.",
+ "optional": true
+ }
+ ],
+ "extraParameters": [
+ {
+ "name": "parameters",
+ "description": "Descriptions for the address book created by registering this listener.",
+ "type": "object",
+ "properties": {
+ "addressBookName": {
+ "type": "string",
+ "optional": true,
+ "description": "The name of the created address book."
+ },
+ "isSecure": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the address book search queries are using encrypted protocols like HTTPS."
+ },
+ "id": {
+ "type": "string",
+ "optional": true,
+ "description": "The unique ID of the created address book. If several listeners have been added, the ``id`` allows to identify which address book initiated the search request. If not provided, a unique ID will be generated for you."
+ }
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "namespace": "contacts",
+ "permissions": ["addressBooks"],
+ "types": [
+ {
+ "id": "QueryInfo",
+ "description": "Object defining a query for :ref:`contacts.quickSearch`.",
+ "type": "object",
+ "properties": {
+ "searchString": {
+ "type": "string",
+ "optional": true,
+ "description": "One or more space-separated terms to search for."
+ },
+ "includeLocal": {
+ "type": "boolean",
+ "optional": true,
+ "default": true,
+ "description": "Whether to include results from local address books. Defaults to true."
+ },
+ "includeRemote": {
+ "type": "boolean",
+ "optional": true,
+ "default": true,
+ "description": "Whether to include results from remote address books. Defaults to true."
+ },
+ "includeReadOnly": {
+ "type": "boolean",
+ "optional": true,
+ "default": true,
+ "description": "Whether to include results from read-only address books. Defaults to true."
+ },
+ "includeReadWrite": {
+ "type": "boolean",
+ "optional": true,
+ "default": true,
+ "description": "Whether to include results from read-write address books. Defaults to true."
+ }
+ }
+ },
+ {
+ "id": "ContactNode",
+ "type": "object",
+ "description": "A node representing a contact in an address book.",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique identifier for the node. IDs are unique within the current profile, and they remain valid even after the program is restarted."
+ },
+ "parentId": {
+ "type": "string",
+ "optional": true,
+ "description": "The ``id`` of the parent object."
+ },
+ "type": {
+ "$ref": "addressBooks.NodeType",
+ "description": "Always set to <value>contact</value>."
+ },
+ "readOnly": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Indicates if the object is read-only."
+ },
+ "remote": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Indicates if the object came from a remote address book."
+ },
+ "properties": {
+ "$ref": "ContactProperties"
+ }
+ }
+ },
+ {
+ "id": "ContactProperties",
+ "type": "object",
+ "description": "A set of individual properties for a particular contact, and its vCard string. Further information can be found in :ref:`howto_contacts`.",
+ "patternProperties": {
+ "^\\w+$": {
+ "choices": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ }
+ },
+ {
+ "id": "PropertyChange",
+ "type": "object",
+ "description": "A dictionary of changed properties. Keys are the property name that changed, values are an object containing ``oldValue`` and ``newValue``. Values can be either a string or <value>null</value>.",
+ "patternProperties": {
+ "^\\w+$": {
+ "type": "object",
+ "properties": {
+ "oldValue": {
+ "choices": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "newValue": {
+ "choices": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ }
+ }
+ }
+ }
+ ],
+ "functions": [
+ {
+ "name": "list",
+ "type": "function",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "parentId",
+ "type": "string"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "ContactNode"
+ }
+ }
+ ]
+ }
+ ],
+ "description": "Gets all the contacts in the address book with the id ``parentId``."
+ },
+ {
+ "name": "quickSearch",
+ "type": "function",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "parentId",
+ "type": "string",
+ "optional": true,
+ "description": "The id of the address book to search. If not specified, all address books are searched."
+ },
+ {
+ "name": "queryInfo",
+ "description": "Either a <em>string</em> with one or more space-separated terms to search for, or a complex :ref:`contacts.QueryInfo` search query.",
+ "choices": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "QueryInfo"
+ }
+ ]
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "ContactNode"
+ }
+ }
+ ]
+ }
+ ],
+ "description": "Gets all contacts matching ``queryInfo`` in the address book with the id ``parentId``."
+ },
+ {
+ "name": "get",
+ "type": "function",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "id",
+ "type": "string"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "$ref": "ContactNode"
+ }
+ ]
+ }
+ ],
+ "description": "Gets a single contact."
+ },
+ {
+ "name": "getPhoto",
+ "type": "function",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "id",
+ "type": "string"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "type": "object",
+ "optional": true,
+ "isInstanceOf": "File",
+ "additionalProperties": true
+ }
+ ]
+ }
+ ],
+ "description": "Gets the photo associated with this contact, if any."
+ },
+ {
+ "name": "setPhoto",
+ "type": "function",
+ "async": true,
+ "parameters": [
+ {
+ "name": "id",
+ "type": "string"
+ },
+ {
+ "name": "file",
+ "type": "object",
+ "isInstanceOf": "File",
+ "additionalProperties": true
+ }
+ ],
+ "description": "Sets the photo associated with this contact."
+ },
+ {
+ "name": "create",
+ "type": "function",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "parentId",
+ "type": "string"
+ },
+ {
+ "name": "id",
+ "type": "string",
+ "description": "Assigns the contact an id. If an existing contact has this id, an exception is thrown. **Note:** Deprecated, the card's id should be specified in the vCard string instead.",
+ "optional": true
+ },
+ {
+ "name": "properties",
+ "$ref": "ContactProperties",
+ "description": "The properties object for the new contact. If it includes a ``vCard`` member, all specified `legacy properties <|link-legacy-properties|>`__ are ignored and the new contact will be based on the provided vCard string. If a UID is specified in the vCard string, which is already used by another contact, an exception is thrown. **Note:** Using individual properties is deprecated, use the ``vCard`` member instead."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "type": "string",
+ "description": "The ID of the new contact."
+ }
+ ]
+ }
+ ],
+ "description": "Adds a new contact to the address book with the id ``parentId``."
+ },
+ {
+ "name": "update",
+ "type": "function",
+ "async": true,
+ "parameters": [
+ {
+ "name": "id",
+ "type": "string"
+ },
+ {
+ "name": "properties",
+ "$ref": "ContactProperties",
+ "description": "An object with properties to update the specified contact. Individual properties are removed, if they are set to <value>null</value>. If the provided object includes a ``vCard`` member, all specified `legacy properties <|link-legacy-properties|>`__ are ignored and the details of the contact will be replaced by the provided vCard. Changes to the UID will be ignored. **Note:** Using individual properties is deprecated, use the ``vCard`` member instead. "
+ }
+ ],
+ "description": "Updates a contact."
+ },
+ {
+ "name": "delete",
+ "type": "function",
+ "async": true,
+ "parameters": [
+ {
+ "name": "id",
+ "type": "string"
+ }
+ ],
+ "description": "Removes a contact from the address book. The contact is also removed from any mailing lists it is a member of."
+ }
+ ],
+ "events": [
+ {
+ "name": "onCreated",
+ "type": "function",
+ "description": "Fired when a contact is created.",
+ "parameters": [
+ {
+ "name": "node",
+ "$ref": "ContactNode"
+ }
+ ]
+ },
+ {
+ "name": "onUpdated",
+ "type": "function",
+ "description": "Fired when a contact is changed.",
+ "parameters": [
+ {
+ "name": "node",
+ "$ref": "ContactNode"
+ },
+ {
+ "name": "changedProperties",
+ "$ref": "PropertyChange"
+ }
+ ]
+ },
+ {
+ "name": "onDeleted",
+ "type": "function",
+ "description": "Fired when a contact is removed from an address book.",
+ "parameters": [
+ {
+ "name": "parentId",
+ "type": "string"
+ },
+ {
+ "name": "id",
+ "type": "string"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "namespace": "mailingLists",
+ "permissions": ["addressBooks"],
+ "types": [
+ {
+ "id": "MailingListNode",
+ "type": "object",
+ "description": "A node representing a mailing list.",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The unique identifier for the node. IDs are unique within the current profile, and they remain valid even after the program is restarted."
+ },
+ "parentId": {
+ "type": "string",
+ "optional": true,
+ "description": "The ``id`` of the parent object."
+ },
+ "type": {
+ "$ref": "addressBooks.NodeType",
+ "description": "Always set to <value>mailingList</value>."
+ },
+ "readOnly": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Indicates if the object is read-only."
+ },
+ "remote": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Indicates if the object came from a remote address book."
+ },
+ "name": {
+ "type": "string"
+ },
+ "nickName": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ },
+ "contacts": {
+ "type": "array",
+ "optional": true,
+ "items": {
+ "$ref": "contacts.ContactNode"
+ },
+ "description": "A list of contacts held by this node's address book or mailing list."
+ }
+ }
+ }
+ ],
+ "functions": [
+ {
+ "name": "list",
+ "type": "function",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "parentId",
+ "type": "string"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "MailingListNode"
+ }
+ }
+ ]
+ }
+ ],
+ "description": "Gets all the mailing lists in the address book with id ``parentId``."
+ },
+ {
+ "name": "get",
+ "type": "function",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "id",
+ "type": "string"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "$ref": "MailingListNode"
+ }
+ ]
+ }
+ ],
+ "description": "Gets a single mailing list."
+ },
+ {
+ "name": "create",
+ "type": "function",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "parentId",
+ "type": "string"
+ },
+ {
+ "name": "properties",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "nickName": {
+ "type": "string",
+ "optional": true
+ },
+ "description": {
+ "type": "string",
+ "optional": true
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "type": "string",
+ "description": "The ID of the new mailing list."
+ }
+ ]
+ }
+ ],
+ "description": "Creates a new mailing list in the address book with id ``parentId``."
+ },
+ {
+ "name": "update",
+ "type": "function",
+ "async": true,
+ "parameters": [
+ {
+ "name": "id",
+ "type": "string"
+ },
+ {
+ "name": "properties",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "nickName": {
+ "type": "string",
+ "optional": true
+ },
+ "description": {
+ "type": "string",
+ "optional": true
+ }
+ }
+ }
+ ],
+ "description": "Edits the properties of a mailing list."
+ },
+ {
+ "name": "delete",
+ "type": "function",
+ "async": true,
+ "parameters": [
+ {
+ "name": "id",
+ "type": "string"
+ }
+ ],
+ "description": "Removes the mailing list."
+ },
+ {
+ "name": "addMember",
+ "type": "function",
+ "async": true,
+ "parameters": [
+ {
+ "name": "id",
+ "type": "string"
+ },
+ {
+ "name": "contactId",
+ "type": "string"
+ }
+ ],
+ "description": "Adds a contact to the mailing list with id ``id``. If the contact and mailing list are in different address books, the contact will also be copied to the list's address book."
+ },
+ {
+ "name": "listMembers",
+ "type": "function",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "id",
+ "type": "string"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "contacts.ContactNode"
+ }
+ }
+ ]
+ }
+ ],
+ "description": "Gets all contacts that are members of the mailing list with id ``id``."
+ },
+ {
+ "name": "removeMember",
+ "type": "function",
+ "async": true,
+ "parameters": [
+ {
+ "name": "id",
+ "type": "string"
+ },
+ {
+ "name": "contactId",
+ "type": "string"
+ }
+ ],
+ "description": "Removes a contact from the mailing list with id ``id``. This does not delete the contact from the address book."
+ }
+ ],
+ "events": [
+ {
+ "name": "onCreated",
+ "type": "function",
+ "description": "Fired when a mailing list is created.",
+ "parameters": [
+ {
+ "name": "node",
+ "$ref": "MailingListNode"
+ }
+ ]
+ },
+ {
+ "name": "onUpdated",
+ "type": "function",
+ "description": "Fired when a mailing list is changed.",
+ "parameters": [
+ {
+ "name": "node",
+ "$ref": "MailingListNode"
+ }
+ ]
+ },
+ {
+ "name": "onDeleted",
+ "type": "function",
+ "description": "Fired when a mailing list is deleted.",
+ "parameters": [
+ {
+ "name": "parentId",
+ "type": "string"
+ },
+ {
+ "name": "id",
+ "type": "string"
+ }
+ ]
+ },
+ {
+ "name": "onMemberAdded",
+ "type": "function",
+ "description": "Fired when a contact is added to the mailing list.",
+ "parameters": [
+ {
+ "name": "node",
+ "$ref": "contacts.ContactNode"
+ }
+ ]
+ },
+ {
+ "name": "onMemberRemoved",
+ "type": "function",
+ "description": "Fired when a contact is removed from the mailing list.",
+ "parameters": [
+ {
+ "name": "parentId",
+ "type": "string"
+ },
+ {
+ "name": "id",
+ "type": "string"
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/comm/mail/components/extensions/schemas/browserAction.json b/comm/mail/components/extensions/schemas/browserAction.json
new file mode 100644
index 0000000000..ed1900f1e0
--- /dev/null
+++ b/comm/mail/components/extensions/schemas/browserAction.json
@@ -0,0 +1,848 @@
+[
+ {
+ "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": "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 ``light`` icon is used on dark backgrounds and vice versa. **Note:** The default theme uses the ``default_icon`` 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 <value>menu</value>.",
+ "preprocess": "localize"
+ },
+ "browser_style": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Enable browser styles. See the `MDN documentation on browser styles <|link-mdn-browser-styles|>`__ for more information.",
+ "default": false
+ },
+ "default_windows": {
+ "description": "Defines the windows, the action button should appear in. Defaults to showing it only in the <value>normal</value> Thunderbird window, but can also be shown in the <value>messageDisplay</value> 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 <value>mail</value> space. The <value>default</value> 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 <code>button</code>.",
+ "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": "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 ``light`` icon is used on dark backgrounds and vice versa. **Note:** The default theme uses the ``default_icon`` 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 <value>menu</value>.",
+ "preprocess": "localize"
+ },
+ "browser_style": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Enable browser styles. See the `MDN documentation on browser styles <|link-mdn-browser-styles|>`__ for more information.",
+ "default": false
+ },
+ "default_area": {
+ "description": "Defines the location the browserAction button will appear. Deprecated and ignored. Replaced by ``allowed_spaces``",
+ "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 <value>normal</value> Thunderbird window, but can also be shown in the <value>messageDisplay</value> 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 <value>mail</value> space. The <value>default</value> 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 <code>button</code>.",
+ "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 <value>[255, 0, 0, 255]</value>.",
+ "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 |ImageData| object (for example, from a |Canvas| element)."
+ },
+ {
+ "id": "ImageDataDictionary",
+ "type": "object",
+ "description": "A <em>dictionary object</em> to specify multiple |ImageData| 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 |ImageData| object, and <em>name</em> its size. Example: <literalinclude>includes/ImageDataDictionary.json<lang>JavaScript</lang></literalinclude>See the `MDN documentation about choosing icon sizes <|link-mdn-icon-size|>`__ 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 <value>null</value> 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",
+ "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 <value>null</value>."
+ },
+ "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.",
+ "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 label is retrieved."
+ },
+ "windowId": {
+ "type": "integer",
+ "optional": true,
+ "minimum": -2,
+ "unsupported": true,
+ "description": "Will throw an error if used."
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "result",
+ "type": "string",
+ "optional": true
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "setIcon",
+ "type": "function",
+ "description": "Sets the icon for the action button. Either the ``path`` or the ``imageData`` 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 <value>null</value> (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",
+ "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 <value>null</value> 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 label is retrieved."
+ },
+ "windowId": {
+ "type": "integer",
+ "optional": true,
+ "minimum": -2,
+ "unsupported": true,
+ "description": "Will throw an error if used."
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "result",
+ "type": "string"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "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 <value>null</value> or an empty string."
+ },
+ "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 label is retrieved."
+ },
+ "windowId": {
+ "type": "integer",
+ "optional": true,
+ "minimum": -2,
+ "unsupported": true,
+ "description": "Will throw an error if used."
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "result",
+ "$ref": "ColorArray"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "enable",
+ "type": "function",
+ "description": "Enables the action button for a specific tab (if a ``tabId`` 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 ``tabId`` 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 <value>menu</value>, 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 `restrictions <|link-user-input-restrictions|>`__ 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"
+ }
+]
diff --git a/comm/mail/components/extensions/schemas/chrome_settings_overrides.json b/comm/mail/components/extensions/schemas/chrome_settings_overrides.json
new file mode 100644
index 0000000000..4fe67050f3
--- /dev/null
+++ b/comm/mail/components/extensions/schemas/chrome_settings_overrides.json
@@ -0,0 +1,194 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "WebExtensionManifest",
+ "properties": {
+ "chrome_settings_overrides": {
+ "type": "object",
+ "optional": true,
+ "additionalProperties": {
+ "$ref": "UnrecognizedProperty"
+ },
+ "properties": {
+ "search_provider": {
+ "type": "object",
+ "optional": true,
+ "additionalProperties": {
+ "$ref": "UnrecognizedProperty"
+ },
+ "properties": {
+ "name": {
+ "type": "string",
+ "preprocess": "localize"
+ },
+ "keyword": {
+ "optional": true,
+ "choices": [
+ {
+ "type": "string",
+ "preprocess": "localize"
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "preprocess": "localize"
+ },
+ "minItems": 1
+ }
+ ]
+ },
+ "search_url": {
+ "type": "string",
+ "format": "url",
+ "pattern": "^https://.*$",
+ "preprocess": "localize"
+ },
+ "favicon_url": {
+ "type": "string",
+ "optional": true,
+ "format": "url",
+ "preprocess": "localize"
+ },
+ "suggest_url": {
+ "type": "string",
+ "optional": true,
+ "pattern": "^https://.*$|^$",
+ "preprocess": "localize"
+ },
+ "instant_url": {
+ "type": "string",
+ "optional": true,
+ "format": "url",
+ "preprocess": "localize",
+ "deprecated": "Unsupported on Thunderbird at this time."
+ },
+ "image_url": {
+ "type": "string",
+ "optional": true,
+ "format": "url",
+ "preprocess": "localize",
+ "deprecated": "Unsupported on Thunderbird at this time."
+ },
+ "search_url_get_params": {
+ "type": "string",
+ "optional": true,
+ "preprocess": "localize",
+ "description": "GET parameters to the search_url as a query string."
+ },
+ "search_url_post_params": {
+ "type": "string",
+ "optional": true,
+ "preprocess": "localize",
+ "description": "POST parameters to the search_url as a query string."
+ },
+ "suggest_url_get_params": {
+ "type": "string",
+ "optional": true,
+ "preprocess": "localize",
+ "description": "GET parameters to the suggest_url as a query string."
+ },
+ "suggest_url_post_params": {
+ "type": "string",
+ "optional": true,
+ "preprocess": "localize",
+ "description": "POST parameters to the suggest_url as a query string."
+ },
+ "instant_url_post_params": {
+ "type": "string",
+ "optional": true,
+ "preprocess": "localize",
+ "deprecated": "Unsupported on Thunderbird at this time."
+ },
+ "image_url_post_params": {
+ "type": "string",
+ "optional": true,
+ "preprocess": "localize",
+ "deprecated": "Unsupported on Thunderbird at this time."
+ },
+ "search_form": {
+ "type": "string",
+ "optional": true,
+ "format": "url",
+ "pattern": "^https://.*$",
+ "preprocess": "localize"
+ },
+ "alternate_urls": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "format": "url",
+ "preprocess": "localize"
+ },
+ "optional": true,
+ "deprecated": "Unsupported on Thunderbird at this time."
+ },
+ "prepopulated_id": {
+ "type": "integer",
+ "optional": true,
+ "deprecated": "Unsupported on Thunderbird."
+ },
+ "encoding": {
+ "type": "string",
+ "optional": true,
+ "description": "Encoding of the search term."
+ },
+ "is_default": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Sets the default engine to a built-in engine only."
+ },
+ "params": {
+ "optional": true,
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "A url parameter name"
+ },
+ "condition": {
+ "type": "string",
+ "optional": true,
+ "enum": ["purpose", "pref"],
+ "description": "The type of param can be either \"purpose\" or \"pref\"."
+ },
+ "pref": {
+ "type": "string",
+ "optional": true,
+ "description": "The preference to retrieve the value from."
+ },
+ "purpose": {
+ "type": "string",
+ "optional": true,
+ "enum": [
+ "contextmenu",
+ "searchbar",
+ "homepage",
+ "keyword",
+ "newtab"
+ ],
+ "description": "The context that initiates a search, required if condition is \"purpose\"."
+ },
+ "value": {
+ "type": "string",
+ "optional": true,
+ "description": "A url parameter value.",
+ "preprocess": "localize"
+ }
+ }
+ },
+ "description": "A list of optional search url parameters. This allows the addition of search url parameters based on how the search is performed in Thunderbird."
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ ]
+ }
+]
diff --git a/comm/mail/components/extensions/schemas/cloudFile.json b/comm/mail/components/extensions/schemas/cloudFile.json
new file mode 100644
index 0000000000..41c587881d
--- /dev/null
+++ b/comm/mail/components/extensions/schemas/cloudFile.json
@@ -0,0 +1,501 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "WebExtensionManifest",
+ "properties": {
+ "cloud_file": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "UnrecognizedProperty"
+ },
+ "properties": {
+ "browser_style": {
+ "type": "boolean",
+ "description": "Enable browser styles in the ``management_url`` page. See the `MDN documentation on browser styles <|link-mdn-browser-styles|>`__ for more information.",
+ "optional": true,
+ "default": false
+ },
+ "data_format": {
+ "type": "string",
+ "optional": true,
+ "deprecated": true,
+ "description": "This property is no longer used. The only supported data format for the ``data`` argument in :ref:`cloudFile.onFileUpload` is |File|."
+ },
+ "reuse_uploads": {
+ "description": "If a previously uploaded cloud file attachment is reused at a later time in a different message, Thunderbird may use the already known ``url`` and ``templateInfo`` values without triggering the registered :ref:`cloudFile.onFileUpload` listener again. Setting this option to <value>false</value> will always trigger the registered listener, providing the already known values through the ``relatedFileInfo`` parameter of the :ref:`cloudFile.onFileUpload` event, to let the provider decide how to handle these cases.",
+ "type": "boolean",
+ "optional": true,
+ "default": true
+ },
+ "management_url": {
+ "type": "string",
+ "format": "relativeUrl",
+ "preprocess": "localize",
+ "description": "A page for configuring accounts, to be displayed in the preferences UI. **Note:** Within this UI only a limited subset of the WebExtension APIs is available: ``cloudFile``, ``extension``, ``i18n``, ``runtime``, ``storage``, ``test``."
+ },
+ "name": {
+ "type": "string",
+ "preprocess": "localize",
+ "description": "Name of the cloud file service."
+ },
+ "new_account_url": {
+ "type": "string",
+ "optional": true,
+ "deprecated": true,
+ "description": "This property was never used."
+ },
+ "service_url": {
+ "type": "string",
+ "optional": true,
+ "deprecated": true,
+ "description": "This property is no longer used. The ``service_url`` property of the :ref:`cloudFile.CloudFileTemplateInfo` object returned by the :ref:`cloudFile.onFileUpload` event can be used to add a <em>Learn more about</em> link to the footer of the cloud file attachment element."
+ }
+ },
+ "optional": true
+ }
+ }
+ }
+ ]
+ },
+ {
+ "namespace": "cloudFile",
+ "permissions": ["manifest:cloud_file"],
+ "allowedContexts": ["content"],
+ "events": [
+ {
+ "name": "onFileUpload",
+ "type": "function",
+ "description": "Fired when a file should be uploaded to the cloud file provider.",
+ "parameters": [
+ {
+ "name": "account",
+ "$ref": "CloudFileAccount",
+ "description": "The account used for the file upload."
+ },
+ {
+ "name": "fileInfo",
+ "$ref": "CloudFile",
+ "description": "The file to upload."
+ },
+ {
+ "name": "tab",
+ "$ref": "tabs.Tab",
+ "description": "The tab where the upload was initiated. Currently only available for the message composer."
+ },
+ {
+ "$ref": "RelatedCloudFile",
+ "name": "relatedFileInfo",
+ "optional": true,
+ "description": "Information about an already uploaded file, which is related to this upload."
+ }
+ ],
+ "returns": {
+ "type": "object",
+ "properties": {
+ "aborted": {
+ "type": "boolean",
+ "description": "Set this to <value>true</value> if the file upload was aborted by the user and an :ref:`cloudFile.onFileUploadAbort` event has been received. No error message will be shown to the user.",
+ "optional": true
+ },
+ "error": {
+ "choices": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "string"
+ }
+ ],
+ "description": "Report an error to the user. Set this to <value>true</value> for showing a generic error message, or set a specific error message.",
+ "optional": true
+ },
+ "url": {
+ "type": "string",
+ "description": "The URL where the uploaded file can be accessed.",
+ "optional": true
+ },
+ "templateInfo": {
+ "$ref": "CloudFileTemplateInfo",
+ "description": "Additional file information used in the cloud file entry added to the message.",
+ "optional": true
+ }
+ }
+ }
+ },
+ {
+ "name": "onFileUploadAbort",
+ "type": "function",
+ "parameters": [
+ {
+ "name": "account",
+ "$ref": "CloudFileAccount",
+ "description": "The account used for the file upload."
+ },
+ {
+ "type": "integer",
+ "name": "fileId",
+ "minimum": 1,
+ "description": "An identifier for this file."
+ },
+ {
+ "name": "tab",
+ "$ref": "tabs.Tab",
+ "description": "The tab where the upload was initiated. Currently only available for the message composer."
+ }
+ ]
+ },
+ {
+ "name": "onFileRename",
+ "type": "function",
+ "description": "Fired when a previously uploaded file should be renamed.",
+ "parameters": [
+ {
+ "name": "account",
+ "$ref": "CloudFileAccount",
+ "description": "The account used for the file upload."
+ },
+ {
+ "type": "integer",
+ "name": "fileId",
+ "minimum": 1,
+ "description": "An identifier for the file which should be renamed."
+ },
+ {
+ "type": "string",
+ "name": "newName",
+ "description": "The new name of the file."
+ },
+ {
+ "name": "tab",
+ "$ref": "tabs.Tab",
+ "description": "The tab where the rename was initiated. Currently only available for the message composer."
+ }
+ ],
+ "returns": {
+ "type": "object",
+ "properties": {
+ "error": {
+ "choices": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "string"
+ }
+ ],
+ "description": "Report an error to the user. Set this to <value>true</value> for showing a generic error message, or set a specific error message.",
+ "optional": true
+ },
+ "url": {
+ "type": "string",
+ "description": "The URL where the renamed file can be accessed.",
+ "optional": true
+ }
+ }
+ }
+ },
+ {
+ "name": "onFileDeleted",
+ "type": "function",
+ "description": "Fired when a previously uploaded file should be deleted.",
+ "parameters": [
+ {
+ "name": "account",
+ "$ref": "CloudFileAccount",
+ "description": "The account used for the file upload."
+ },
+ {
+ "type": "integer",
+ "name": "fileId",
+ "minimum": 1,
+ "description": "An identifier for this file."
+ },
+ {
+ "name": "tab",
+ "$ref": "tabs.Tab",
+ "description": "The tab where the upload was initiated. Currently only available for the message composer."
+ }
+ ]
+ },
+ {
+ "name": "onAccountAdded",
+ "type": "function",
+ "description": "Fired when a cloud file account of this add-on was created.",
+ "parameters": [
+ {
+ "name": "account",
+ "$ref": "CloudFileAccount",
+ "description": "The created account."
+ }
+ ]
+ },
+ {
+ "name": "onAccountDeleted",
+ "type": "function",
+ "description": "Fired when a cloud file account of this add-on was deleted.",
+ "parameters": [
+ {
+ "name": "accountId",
+ "type": "string",
+ "description": "The id of the removed account."
+ }
+ ]
+ }
+ ],
+ "types": [
+ {
+ "id": "CloudFileAccount",
+ "type": "object",
+ "description": "Information about a cloud file account.",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Unique identifier of the account."
+ },
+ "configured": {
+ "type": "boolean",
+ "description": "If true, the account is configured and ready to use. Only configured accounts are offered to the user."
+ },
+ "name": {
+ "type": "string",
+ "description": "A user-friendly name for this account."
+ },
+ "uploadSizeLimit": {
+ "type": "integer",
+ "minimum": -1,
+ "optional": true,
+ "description": "The maximum size in bytes for a single file to upload. Set to <value>-1</value> if unlimited."
+ },
+ "spaceRemaining": {
+ "type": "integer",
+ "minimum": -1,
+ "optional": true,
+ "description": "The amount of remaining space on the cloud provider, in bytes. Set to <value>-1</value> if unsupported."
+ },
+ "spaceUsed": {
+ "type": "integer",
+ "minimum": -1,
+ "optional": true,
+ "description": "The amount of space already used on the cloud provider, in bytes. Set to <value>-1</value> if unsupported."
+ },
+ "managementUrl": {
+ "type": "string",
+ "format": "relativeUrl",
+ "description": "A page for configuring accounts, to be displayed in the preferences UI."
+ }
+ }
+ },
+ {
+ "id": "CloudFileTemplateInfo",
+ "type": "object",
+ "description": "Defines information to be used in the cloud file entry added to the message.",
+ "properties": {
+ "service_icon": {
+ "type": "string",
+ "optional": true,
+ "description": "A URL pointing to an icon to represent the used cloud file service. Defaults to the icon of the provider add-on."
+ },
+ "service_name": {
+ "type": "string",
+ "optional": true,
+ "description": "A name to represent the used cloud file service. Defaults to the associated cloud file account name."
+ },
+ "service_url": {
+ "type": "string",
+ "optional": true,
+ "description": "A URL pointing to a web page of the used cloud file service. Will be used in a <em>Learn more about</em> link in the footer of the cloud file attachment element."
+ },
+ "download_password_protected": {
+ "type": "boolean",
+ "optional": true,
+ "description": "If set to true, the cloud file entry for this upload will include a hint, that the download link is password protected."
+ },
+ "download_limit": {
+ "type": "integer",
+ "optional": true,
+ "description": "If set, the cloud file entry for this upload will include a hint, that the file has a download limit."
+ },
+ "download_expiry_date": {
+ "type": "object",
+ "optional": true,
+ "description": "If set, the cloud file entry for this upload will include a hint, that the link will only be available for a limited time.",
+ "properties": {
+ "timestamp": {
+ "type": "integer",
+ "description": "The expiry date of the link as the number of milliseconds since the UNIX epoch."
+ },
+ "format": {
+ "optional": true,
+ "description": "A format options object as used by |DateTimeFormat|. Defaults to: <literalinclude>includes/cloudFile/defaultDateFormat.js<lang>JavaScript</lang></literalinclude>",
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ }
+ }
+ },
+ {
+ "id": "CloudFile",
+ "type": "object",
+ "description": "Information about a cloud file.",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "minimum": 1,
+ "description": "An identifier for this file."
+ },
+ "name": {
+ "type": "string",
+ "description": "Filename of the file to be transferred."
+ },
+ "data": {
+ "type": "object",
+ "isInstanceOf": "File",
+ "additionalProperties": true,
+ "description": "Contents of the file to be transferred."
+ }
+ }
+ },
+ {
+ "id": "RelatedCloudFile",
+ "type": "object",
+ "description": "Information about an already uploaded cloud file, which is related to a new upload. For example if the content of a cloud attachment is updated, if a repeatedly used cloud attachment is renamed (and therefore should be re-uploaded to not invalidate existing links) or if the provider has its manifest property ``reuse_uploads`` set to <value>false</value>.",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "minimum": 1,
+ "optional": true,
+ "description": "The identifier for the related file. In some circumstances, the id is unavailable."
+ },
+ "url": {
+ "type": "string",
+ "description": "The URL where the upload of the related file can be accessed.",
+ "optional": true
+ },
+ "templateInfo": {
+ "$ref": "CloudFileTemplateInfo",
+ "description": "Additional information of the related file, used in the cloud file entry added to the message.",
+ "optional": true
+ },
+ "name": {
+ "type": "string",
+ "description": "Filename of the related file."
+ },
+ "dataChanged": {
+ "type": "boolean",
+ "description": "The content of the new upload differs from the related file."
+ }
+ }
+ }
+ ],
+ "functions": [
+ {
+ "name": "getAccount",
+ "type": "function",
+ "description": "Retrieve information about a single cloud file account.",
+ "allowedContexts": ["content"],
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "accountId",
+ "type": "string",
+ "description": "Unique identifier of the account."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "$ref": "CloudFileAccount"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getAllAccounts",
+ "type": "function",
+ "description": "Retrieve all cloud file accounts for the current add-on.",
+ "allowedContexts": ["content"],
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "CloudFileAccount"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "updateAccount",
+ "type": "function",
+ "description": "Update a cloud file account.",
+ "allowedContexts": ["content"],
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "accountId",
+ "type": "string",
+ "description": "Unique identifier of the account."
+ },
+ {
+ "name": "updateProperties",
+ "type": "object",
+ "properties": {
+ "configured": {
+ "type": "boolean",
+ "optional": true,
+ "description": "If true, the account is configured and ready to use. Only configured accounts are offered to the user."
+ },
+ "uploadSizeLimit": {
+ "type": "integer",
+ "minimum": -1,
+ "optional": true,
+ "description": "The maximum size in bytes for a single file to upload. Set to <value>-1</value> if unlimited."
+ },
+ "spaceRemaining": {
+ "type": "integer",
+ "minimum": -1,
+ "optional": true,
+ "description": "The amount of remaining space on the cloud provider, in bytes. Set to <value>-1</value> if unsupported."
+ },
+ "spaceUsed": {
+ "type": "integer",
+ "minimum": -1,
+ "optional": true,
+ "description": "The amount of space already used on the cloud provider, in bytes. Set to <value>-1</value> if unsupported."
+ },
+ "managementUrl": {
+ "type": "string",
+ "format": "relativeUrl",
+ "optional": true,
+ "description": "A page for configuring accounts, to be displayed in the preferences UI."
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "$ref": "CloudFileAccount"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/comm/mail/components/extensions/schemas/commands.json b/comm/mail/components/extensions/schemas/commands.json
new file mode 100644
index 0000000000..900e1df1a0
--- /dev/null
+++ b/comm/mail/components/extensions/schemas/commands.json
@@ -0,0 +1,279 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "id": "KeyName",
+ "type": "string",
+ "format": "manifestShortcutKey",
+ "description": "Definition of a shortcut, for example <value>Alt+F5</value>. The string must match the shortcut format as defined by the `MDN page of the commands API <|link-commands-shortcuts|>`__."
+ },
+ {
+ "$extend": "WebExtensionManifest",
+ "properties": {
+ "commands": {
+ "optional": true,
+ "choices": [
+ {
+ "type": "object",
+ "max_manifest_version": 2,
+ "description": "A <em>dictionary object</em> defining one or more commands as <em>name-value</em> pairs, the <em>name</em> being the name of the command and the <em>value</em> being a :ref:`commands.CommandsShortcut`. The <em>name</em> may also be one of the following built-in special shortcuts: \n * <value>_execute_browser_action</value> \n * <value>_execute_compose_action</value> \n * <value>_execute_message_display_action</value>\nExample: <literalinclude>includes/commands/manifest.json<lang>JSON</lang></literalinclude>",
+ "additionalProperties": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "UnrecognizedProperty"
+ },
+ "properties": {
+ "suggested_key": {
+ "type": "object",
+ "optional": true,
+ "properties": {
+ "default": {
+ "$ref": "KeyName",
+ "optional": true
+ },
+ "mac": {
+ "$ref": "KeyName",
+ "optional": true
+ },
+ "linux": {
+ "$ref": "KeyName",
+ "optional": true
+ },
+ "windows": {
+ "$ref": "KeyName",
+ "optional": true
+ },
+ "chromeos": {
+ "type": "string",
+ "optional": true
+ },
+ "android": {
+ "type": "string",
+ "optional": true
+ },
+ "ios": {
+ "type": "string",
+ "optional": true
+ },
+ "additionalProperties": {
+ "type": "string",
+ "deprecated": "Unknown platform name",
+ "optional": true
+ }
+ }
+ },
+ "description": {
+ "type": "string",
+ "preprocess": "localize",
+ "optional": true
+ }
+ }
+ }
+ },
+ {
+ "type": "object",
+ "min_manifest_version": 3,
+ "description": "A <em>dictionary object</em> defining one or more commands as <em>name-value</em> pairs, the <em>name</em> being the name of the command and the <em>value</em> being a :ref:`commands.CommandsShortcut`. The <em>name</em> may also be one of the following built-in special shortcuts: \n * <value>_execute_action</value> \n * <value>_execute_compose_action</value> \n * <value>_execute_message_display_action</value>\nExample: <literalinclude>includes/commands/manifest.json<lang>JSON</lang></literalinclude>",
+ "additionalProperties": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "UnrecognizedProperty"
+ },
+ "properties": {
+ "suggested_key": {
+ "type": "object",
+ "optional": true,
+ "properties": {
+ "default": {
+ "$ref": "KeyName",
+ "optional": true
+ },
+ "mac": {
+ "$ref": "KeyName",
+ "optional": true
+ },
+ "linux": {
+ "$ref": "KeyName",
+ "optional": true
+ },
+ "windows": {
+ "$ref": "KeyName",
+ "optional": true
+ },
+ "chromeos": {
+ "type": "string",
+ "optional": true
+ },
+ "android": {
+ "type": "string",
+ "optional": true
+ },
+ "ios": {
+ "type": "string",
+ "optional": true
+ },
+ "additionalProperties": {
+ "type": "string",
+ "deprecated": "Unknown platform name",
+ "optional": true
+ }
+ }
+ },
+ "description": {
+ "type": "string",
+ "preprocess": "localize",
+ "optional": true
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ ]
+ },
+ {
+ "namespace": "commands",
+ "description": "Use the commands API to add keyboard shortcuts that trigger actions in your extension, for example opening one of the action popups or sending a command to the extension.",
+ "permissions": ["manifest:commands"],
+ "types": [
+ {
+ "id": "Command",
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "optional": true,
+ "description": "The name of the Extension Command"
+ },
+ "description": {
+ "type": "string",
+ "optional": true,
+ "description": "The Extension Command description"
+ },
+ "shortcut": {
+ "type": "string",
+ "optional": true,
+ "description": "The shortcut active for this command, or blank if not active."
+ }
+ }
+ }
+ ],
+ "events": [
+ {
+ "name": "onCommand",
+ "description": "Fired when a registered command is activated using a keyboard shortcut. This is a user input event handler. For asynchronous listeners some `restrictions <|link-user-input-restrictions|>`__ apply.",
+ "type": "function",
+ "parameters": [
+ {
+ "name": "command",
+ "type": "string"
+ },
+ {
+ "name": "tab",
+ "$ref": "tabs.Tab",
+ "description": "The details of the active tab while the command occurred."
+ }
+ ]
+ },
+ {
+ "name": "onChanged",
+ "description": "Fired when a registered command's shortcut is changed.",
+ "type": "function",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "changeInfo",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the shortcut."
+ },
+ "newShortcut": {
+ "type": "string",
+ "description": "The new shortcut active for this command, or blank if not active."
+ },
+ "oldShortcut": {
+ "type": "string",
+ "description": "The old shortcut which is no longer active for this command, or blank if the shortcut was previously inactive."
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "functions": [
+ {
+ "name": "update",
+ "type": "function",
+ "async": true,
+ "description": "Update the details of an already defined command.",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "detail",
+ "description": "The new details for the command.",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the command."
+ },
+ "description": {
+ "type": "string",
+ "optional": true,
+ "description": "The description for the command."
+ },
+ "shortcut": {
+ "type": "string",
+ "format": "manifestShortcutKeyOrEmpty",
+ "optional": true,
+ "description": "An empty string to clear the shortcut, or a string matching the format defined by the `MDN page of the commands API <|link-commands-shortcuts|>`__ to set a new shortcut key. If the string does not match this format, the function throws an error."
+ }
+ }
+ }
+ ]
+ },
+ {
+ "name": "reset",
+ "type": "function",
+ "async": true,
+ "description": "Reset a command's details to what is specified in the manifest.",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "name",
+ "description": "The name of the command."
+ }
+ ]
+ },
+ {
+ "name": "getAll",
+ "type": "function",
+ "async": "callback",
+ "description": "Returns all the registered extension commands for this extension and their shortcut (if active).",
+ "parameters": [
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "commands",
+ "type": "array",
+ "items": {
+ "$ref": "Command"
+ }
+ }
+ ],
+ "description": "Called to return the registered commands."
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/comm/mail/components/extensions/schemas/compose.json b/comm/mail/components/extensions/schemas/compose.json
new file mode 100644
index 0000000000..f6915fc363
--- /dev/null
+++ b/comm/mail/components/extensions/schemas/compose.json
@@ -0,0 +1,937 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "OptionalPermission",
+ "choices": [
+ {
+ "type": "string",
+ "enum": ["compose", "compose.save", "compose.send"]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "namespace": "compose",
+ "types": [
+ {
+ "id": "ComposeRecipient",
+ "choices": [
+ {
+ "type": "string",
+ "description": "A name and email address in the format <value>Name <email@example.com></value>, or just an email address."
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The ID of a contact or mailing list from the :doc:`contacts` and :doc:`mailingLists` APIs."
+ },
+ "type": {
+ "type": "string",
+ "description": "Which sort of object this ID is for.",
+ "enum": ["contact", "mailingList"]
+ }
+ }
+ }
+ ]
+ },
+ {
+ "id": "ComposeRecipientList",
+ "choices": [
+ {
+ "$ref": "ComposeRecipient"
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "ComposeRecipient"
+ }
+ }
+ ]
+ },
+ {
+ "id": "ComposeState",
+ "type": "object",
+ "description": "Represent the state of the message composer.",
+ "properties": {
+ "canSendNow": {
+ "type": "boolean",
+ "description": "The message can be send now."
+ },
+ "canSendLater": {
+ "type": "boolean",
+ "description": "The message can be send later."
+ }
+ }
+ },
+ {
+ "id": "ComposeDetails",
+ "type": "object",
+ "description": "Used by various functions to represent the state of a message being composed. Note that functions using this type may have a partial implementation.",
+ "properties": {
+ "identityId": {
+ "type": "string",
+ "description": "The ID of an identity from the :doc:`accounts` API. The settings from the identity will be used in the composed message. If ``replyTo`` is also specified, the ``replyTo`` property of the identity is overridden. The permission <permission>accountsRead</permission> is required to include the ``identityId``.",
+ "optional": true
+ },
+ "from": {
+ "$ref": "ComposeRecipient",
+ "description": "*Caution*: Setting a value for ``from`` does not change the used identity, it overrides the FROM header. Many email servers do not accept emails where the FROM header does not match the sender identity. Must be set to exactly one valid email address.",
+ "optional": true
+ },
+ "to": {
+ "$ref": "ComposeRecipientList",
+ "optional": true
+ },
+ "cc": {
+ "$ref": "ComposeRecipientList",
+ "optional": true
+ },
+ "bcc": {
+ "$ref": "ComposeRecipientList",
+ "optional": true
+ },
+ "overrideDefaultFcc": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Indicates whether the default fcc setting (defined by the used identity) is being overridden for this message. Setting <value>false</value> will clear the override. Setting <value>true</value> will throw an <em>ExtensionError</em>, if ``overrideDefaultFccFolder`` is not set as well."
+ },
+ "overrideDefaultFccFolder": {
+ "choices": [
+ {
+ "$ref": "folders.MailFolder"
+ },
+ {
+ "type": "string",
+ "enum": [""]
+ }
+ ],
+ "optional": true,
+ "description": " This value overrides the default fcc setting (defined by the used identity) for this message only. Either a :ref:`folders.MailFolder` specifying the folder for the copy of the sent message, or an empty string to not save a copy at all."
+ },
+ "additionalFccFolder": {
+ "choices": [
+ {
+ "$ref": "folders.MailFolder"
+ },
+ {
+ "type": "string",
+ "enum": [""]
+ }
+ ],
+ "description": "An additional fcc folder which can be selected while composing the message, an empty string if not used.",
+ "optional": true
+ },
+ "replyTo": {
+ "$ref": "ComposeRecipientList",
+ "optional": true
+ },
+ "followupTo": {
+ "$ref": "ComposeRecipientList",
+ "optional": true
+ },
+ "newsgroups": {
+ "description": "A single newsgroup name or an array of newsgroup names.",
+ "choices": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ ],
+ "optional": true
+ },
+ "relatedMessageId": {
+ "description": "The id of the original message (in case of draft, template, forward or reply). Read-only. Is <value>null</value> in all other cases or if the original message was opened from file.",
+ "type": "integer",
+ "optional": true
+ },
+ "subject": {
+ "type": "string",
+ "optional": true
+ },
+ "type": {
+ "type": "string",
+ "description": "Read-only. The type of the message being composed, depending on how the compose window was opened by the user.",
+ "enum": ["draft", "new", "redirect", "reply", "forward"],
+ "optional": true
+ },
+ "body": {
+ "type": "string",
+ "description": "The HTML content of the message.",
+ "optional": true
+ },
+ "plainTextBody": {
+ "type": "string",
+ "description": "The plain text content of the message.",
+ "optional": true
+ },
+ "isPlainText": {
+ "type": "boolean",
+ "description": "Whether the message is an HTML message or a plain text message.",
+ "optional": true
+ },
+ "deliveryFormat": {
+ "type": "string",
+ "enum": ["auto", "plaintext", "html", "both"],
+ "description": "Defines the mime format of the sent message (ignored on plain text messages). Defaults to <value>auto</value>, which will send html messages as plain text, if they do not include any formatting, and as <value>both</value> otherwise (a multipart/mixed message).",
+ "optional": true
+ },
+ "customHeaders": {
+ "type": "array",
+ "items": {
+ "$ref": "CustomHeader"
+ },
+ "description": "Array of custom headers. Headers will be returned in <em>Http-Header-Case</em> (a.k.a. <em>Train-Case</em>). Set an empty array to clear all custom headers.",
+ "optional": true
+ },
+ "priority": {
+ "type": "string",
+ "enum": ["lowest", "low", "normal", "high", "highest"],
+ "description": "The priority of the message.",
+ "optional": true
+ },
+ "returnReceipt": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Add the <em>Disposition-Notification-To</em> header to the message to requests the recipients email client to send a reply once the message has been received. Recipient server may strip the header and the recipient might ignore the request."
+ },
+ "deliveryStatusNotification": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Let the sender know when the recipient's server received the message. Not supported by all servers."
+ },
+ "attachVCard": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Wether or not the vCard of the used identity will be attached to the message during send. Note: If the value has not been modified, selecting a different identity will load the default value of the new identity."
+ },
+ "attachments": {
+ "type": "array",
+ "items": {
+ "choices": [
+ {
+ "$ref": "FileAttachment"
+ },
+ {
+ "$ref": "ComposeAttachment"
+ }
+ ]
+ },
+ "description": "Only used in the begin* functions. Attachments to add to the message.",
+ "optional": true
+ }
+ }
+ },
+ {
+ "id": "FileAttachment",
+ "type": "object",
+ "description": "Object used to add, update or rename an attachment in a message being composed.",
+ "properties": {
+ "file": {
+ "type": "object",
+ "isInstanceOf": "File",
+ "additionalProperties": true,
+ "description": "The new content for the attachment.",
+ "optional": true
+ },
+ "name": {
+ "type": "string",
+ "description": "The new name for the attachment, as displayed to the user. If not specified, the name of the provided ``file`` object is used.",
+ "optional": true
+ }
+ }
+ },
+ {
+ "id": "ComposeAttachment",
+ "type": "object",
+ "description": "Represents an attachment in a message being composed.",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "A unique identifier for this attachment."
+ },
+ "name": {
+ "type": "string",
+ "optional": true,
+ "description": "The name of this attachment, as displayed to the user."
+ },
+ "size": {
+ "type": "integer",
+ "optional": true,
+ "description": "The size in bytes of this attachment. Read-only."
+ }
+ }
+ },
+ {
+ "id": "CustomHeader",
+ "type": "object",
+ "description": "A custom header definition.",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Name of a custom header, must have a <value>X-</value> prefix.",
+ "pattern": "^X-.*$"
+ },
+ "value": {
+ "type": "string"
+ }
+ }
+ },
+ {
+ "id": "ComposeDictionaries",
+ "type": "object",
+ "additionalProperties": {
+ "type": "boolean"
+ },
+ "description": "A <em>dictionary object</em> with entries for all installed dictionaries, having a language identifier as <em>key</em> (for example <value>en-US</value>) and a boolean expression as <em>value</em>, indicating whether that dictionary is enabled for spellchecking or not."
+ }
+ ],
+ "events": [
+ {
+ "name": "onBeforeSend",
+ "type": "function",
+ "description": "Fired when a message is about to be sent from the compose window. This is a user input event handler. For asynchronous listeners some `restrictions <|link-user-input-restrictions|>`__ apply.",
+ "permissions": ["compose"],
+ "parameters": [
+ {
+ "name": "tab",
+ "$ref": "tabs.Tab"
+ },
+ {
+ "name": "details",
+ "$ref": "ComposeDetails",
+ "description": "The current state of the compose window. This is functionally the same as calling the :ref:`compose.getComposeDetails` function."
+ }
+ ],
+ "returns": {
+ "type": "object",
+ "properties": {
+ "cancel": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Cancels the send."
+ },
+ "details": {
+ "$ref": "ComposeDetails",
+ "optional": true,
+ "description": "Updates the compose window. This is functionally the same as calling the :ref:`compose.setComposeDetails` function."
+ }
+ }
+ }
+ },
+ {
+ "name": "onAfterSend",
+ "type": "function",
+ "description": "Fired when sending a message succeeded or failed.",
+ "permissions": ["compose"],
+ "parameters": [
+ {
+ "name": "tab",
+ "$ref": "tabs.Tab"
+ },
+ {
+ "name": "sendInfo",
+ "type": "object",
+ "properties": {
+ "mode": {
+ "type": "string",
+ "description": "The used send mode.",
+ "enum": ["sendNow", "sendLater"]
+ },
+ "error": {
+ "type": "string",
+ "description": "An error description, if sending the message failed.",
+ "optional": true
+ },
+ "headerMessageId": {
+ "type": "string",
+ "description": "The header messageId of the outgoing message. Only included for actually sent messages.",
+ "optional": true
+ },
+ "messages": {
+ "type": "array",
+ "items": {
+ "$ref": "messages.MessageHeader"
+ },
+ "description": "Copies of the sent message. The number of created copies depends on the applied file carbon copy configuration (fcc)."
+ }
+ }
+ }
+ ]
+ },
+ {
+ "name": "onAfterSave",
+ "type": "function",
+ "description": "Fired when saving a message as draft or template succeeded or failed.",
+ "permissions": ["compose"],
+ "parameters": [
+ {
+ "name": "tab",
+ "$ref": "tabs.Tab"
+ },
+ {
+ "name": "saveInfo",
+ "type": "object",
+ "properties": {
+ "mode": {
+ "type": "string",
+ "description": "The used save mode.",
+ "enum": ["draft", "template"]
+ },
+ "error": {
+ "type": "string",
+ "description": "An error description, if saving the message failed.",
+ "optional": true
+ },
+ "messages": {
+ "type": "array",
+ "items": {
+ "$ref": "messages.MessageHeader"
+ },
+ "description": "The saved message(s). The number of saved messages depends on the applied file carbon copy configuration (fcc)."
+ }
+ }
+ }
+ ]
+ },
+ {
+ "name": "onAttachmentAdded",
+ "type": "function",
+ "description": "Fired when an attachment is added to a message being composed.",
+ "permissions": ["compose"],
+ "parameters": [
+ {
+ "name": "tab",
+ "$ref": "tabs.Tab"
+ },
+ {
+ "name": "attachment",
+ "$ref": "ComposeAttachment"
+ }
+ ]
+ },
+ {
+ "name": "onAttachmentRemoved",
+ "type": "function",
+ "description": "Fired when an attachment is removed from a message being composed.",
+ "permissions": ["compose"],
+ "parameters": [
+ {
+ "name": "tab",
+ "$ref": "tabs.Tab"
+ },
+ {
+ "name": "attachmentId",
+ "type": "integer"
+ }
+ ]
+ },
+ {
+ "name": "onIdentityChanged",
+ "type": "function",
+ "description": "Fired when the user changes the identity that will be used to send a message being composed.",
+ "permissions": ["accountsRead"],
+ "parameters": [
+ {
+ "name": "tab",
+ "$ref": "tabs.Tab"
+ },
+ {
+ "name": "identityId",
+ "type": "string"
+ }
+ ]
+ },
+ {
+ "name": "onComposeStateChanged",
+ "type": "function",
+ "description": "Fired when the state of the message composer changed.",
+ "parameters": [
+ {
+ "name": "tab",
+ "$ref": "tabs.Tab"
+ },
+ {
+ "name": "state",
+ "$ref": "ComposeState"
+ }
+ ]
+ },
+ {
+ "name": "onActiveDictionariesChanged",
+ "type": "function",
+ "description": "Fired when one or more dictionaries have been activated or deactivated.",
+ "parameters": [
+ {
+ "name": "tab",
+ "$ref": "tabs.Tab"
+ },
+ {
+ "name": "dictionaries",
+ "$ref": "ComposeDictionaries"
+ }
+ ]
+ }
+ ],
+ "functions": [
+ {
+ "name": "beginNew",
+ "type": "function",
+ "description": "Open a new message compose window.\n\n**Note:** The compose format can be set by ``details.isPlainText`` or by specifying only one of ``details.body`` or ``details.plainTextBody``. Otherwise the default compose format of the selected identity is used.\n\n**Note:** Specifying ``details.body`` and ``details.plainTextBody`` without also specifying ``details.isPlainText`` threw an exception in Thunderbird up to version 97. Since Thunderbird 98, this combination creates a compose window with the compose format of the selected identity, using the matching ``details.body`` or ``details.plainTextBody`` value.\n\n**Note:** If no identity is specified, this function is using the default identity and not the identity of the referenced message.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "messageId",
+ "description": "If specified, the message or template to edit as a new message.",
+ "type": "integer",
+ "optional": true,
+ "minimum": 1
+ },
+ {
+ "name": "details",
+ "$ref": "ComposeDetails",
+ "optional": true
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "return",
+ "$ref": "tabs.Tab"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "beginReply",
+ "type": "function",
+ "description": "Open a new message compose window replying to a given message.\n\n**Note:** The compose format can be set by ``details.isPlainText`` or by specifying only one of ``details.body`` or ``details.plainTextBody``. Otherwise the default compose format of the selected identity is used.\n\n**Note:** Specifying ``details.body`` and ``details.plainTextBody`` without also specifying ``details.isPlainText`` threw an exception in Thunderbird up to version 97. Since Thunderbird 98, this combination creates a compose window with the compose format of the selected identity, using the matching ``details.body`` or ``details.plainTextBody`` value.\n\n**Note:** If no identity is specified, this function is using the default identity and not the identity of the referenced message.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "messageId",
+ "description": "The message to reply to, as retrieved using other APIs.",
+ "type": "integer",
+ "minimum": 1
+ },
+ {
+ "name": "replyType",
+ "type": "string",
+ "enum": ["replyToSender", "replyToList", "replyToAll"],
+ "optional": true
+ },
+ {
+ "name": "details",
+ "$ref": "ComposeDetails",
+ "optional": true
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "return",
+ "$ref": "tabs.Tab"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "beginForward",
+ "type": "function",
+ "description": "Open a new message compose window forwarding a given message.\n\n**Note:** The compose format can be set by ``details.isPlainText`` or by specifying only one of ``details.body`` or ``details.plainTextBody``. Otherwise the default compose format of the selected identity is used.\n\n**Note:** Specifying ``details.body`` and ``details.plainTextBody`` without also specifying ``details.isPlainText`` threw an exception in Thunderbird up to version 97. Since Thunderbird 98, this combination creates a compose window with the compose format of the selected identity, using the matching ``details.body`` or ``details.plainTextBody`` value.\n\n**Note:** If no identity is specified, this function is using the default identity and not the identity of the referenced message.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "messageId",
+ "description": "The message to forward, as retrieved using other APIs.",
+ "type": "integer",
+ "minimum": 1
+ },
+ {
+ "name": "forwardType",
+ "type": "string",
+ "enum": ["forwardInline", "forwardAsAttachment"],
+ "optional": true
+ },
+ {
+ "name": "details",
+ "$ref": "ComposeDetails",
+ "optional": true
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "return",
+ "$ref": "tabs.Tab"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getComposeDetails",
+ "type": "function",
+ "async": "callback",
+ "description": "Fetches the current state of a compose window. Currently only a limited amount of information is available, more will be added in later versions.",
+ "permissions": ["compose"],
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "minimum": 0
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "$ref": "ComposeDetails"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "setComposeDetails",
+ "type": "function",
+ "async": true,
+ "description": "Updates the compose window. The properties of the given :ref:`compose.ComposeDetails` object will be used to overwrite the current values of the specified compose window, so only properties that are to be changed should be included.\n\nWhen updating any of the array properties (``customHeaders`` and most address fields), make sure to first get the current values to not accidentally remove all existing entries when setting the new value.\n\n**Note:** The compose format of an existing compose window cannot be changed. Since Thunderbird 98, setting conflicting values for ``details.body``, ``details.plainTextBody`` or ``details.isPlaintext`` no longer throws an exception, instead the compose window chooses the matching ``details.body`` or ``details.plainTextBody`` value and ignores the other.",
+ "permissions": ["compose"],
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "minimum": 0
+ },
+ {
+ "name": "details",
+ "$ref": "ComposeDetails"
+ }
+ ]
+ },
+ {
+ "name": "getActiveDictionaries",
+ "type": "function",
+ "async": "callback",
+ "description": "Returns a :ref:`compose.ComposeDictionaries` object, listing all installed dictionaries, including the information whether they are currently enabled or not.",
+ "permissions": ["compose"],
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "minimum": 0
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "$ref": "ComposeDictionaries"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "setActiveDictionaries",
+ "type": "function",
+ "async": true,
+ "description": "Updates the active dictionaries. Throws if the ``activeDictionaries`` array contains unknown or invalid language identifiers.",
+ "permissions": ["compose"],
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "minimum": 0
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "name": "activeDictionaries"
+ }
+ ]
+ },
+ {
+ "name": "listAttachments",
+ "type": "function",
+ "description": "Lists all of the attachments of the message being composed in the specified tab.",
+ "permissions": ["compose"],
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "tabId",
+ "type": "integer"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "ComposeAttachment"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getAttachmentFile",
+ "type": "function",
+ "description": "Gets the content of a :ref:`compose.ComposeAttachment` as a |File| object.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "id",
+ "type": "integer",
+ "description": "The unique identifier for the attachment."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "type": "object",
+ "isInstanceOf": "File",
+ "additionalProperties": true
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "addAttachment",
+ "type": "function",
+ "description": "Adds an attachment to the message being composed in the specified tab.",
+ "permissions": ["compose"],
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "tabId",
+ "type": "integer"
+ },
+ {
+ "name": "attachment",
+ "choices": [
+ {
+ "$ref": "FileAttachment"
+ },
+ {
+ "$ref": "ComposeAttachment"
+ }
+ ]
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "$ref": "ComposeAttachment"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "updateAttachment",
+ "type": "function",
+ "description": "Updates the name and/or the content of an attachment in the message being composed in the specified tab. If the specified attachment is a cloud file attachment and the associated provider failed to update the attachment, the function will throw an <em>ExtensionError</em>.",
+ "permissions": ["compose"],
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "tabId",
+ "type": "integer"
+ },
+ {
+ "name": "attachmentId",
+ "type": "integer"
+ },
+ {
+ "name": "attachment",
+ "$ref": "FileAttachment"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "$ref": "ComposeAttachment"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "removeAttachment",
+ "type": "function",
+ "description": "Removes an attachment from the message being composed in the specified tab.",
+ "permissions": ["compose"],
+ "async": true,
+ "parameters": [
+ {
+ "name": "tabId",
+ "type": "integer"
+ },
+ {
+ "name": "attachmentId",
+ "type": "integer"
+ }
+ ]
+ },
+ {
+ "name": "sendMessage",
+ "permissions": ["compose.send"],
+ "type": "function",
+ "description": "Sends the message currently being composed. If the send mode is not specified or set to <value>default</value>, the message will be send directly if the user is online and placed in the users outbox otherwise. The returned Promise fulfills once the message has been successfully sent or placed in the user's outbox. Throws when the send process has been aborted by the user, by an :ref:`compose.onBeforeSend` event or if there has been an error while sending the message to the outgoing mail server.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "tabId",
+ "type": "integer"
+ },
+ {
+ "name": "options",
+ "type": "object",
+ "optional": true,
+ "properties": {
+ "mode": {
+ "type": "string",
+ "enum": ["default", "sendNow", "sendLater"]
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "return",
+ "type": "object",
+ "properties": {
+ "mode": {
+ "type": "string",
+ "description": "The used send mode.",
+ "enum": ["sendNow", "sendLater"]
+ },
+ "headerMessageId": {
+ "type": "string",
+ "description": "The header messageId of the outgoing message. Only included for actually sent messages.",
+ "optional": true
+ },
+ "messages": {
+ "type": "array",
+ "items": {
+ "$ref": "messages.MessageHeader"
+ },
+ "description": "Copies of the sent message. The number of created copies depends on the applied file carbon copy configuration (fcc)."
+ }
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "saveMessage",
+ "permissions": ["compose.save"],
+ "type": "function",
+ "description": "Saves the message currently being composed as a draft or as a template. If the save mode is not specified, the message will be saved as a draft. The returned Promise fulfills once the message has been successfully saved.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "tabId",
+ "type": "integer"
+ },
+ {
+ "name": "options",
+ "type": "object",
+ "optional": true,
+ "properties": {
+ "mode": {
+ "type": "string",
+ "enum": ["draft", "template"]
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "return",
+ "type": "object",
+ "properties": {
+ "mode": {
+ "type": "string",
+ "description": "The used save mode.",
+ "enum": ["draft", "template"]
+ },
+ "messages": {
+ "type": "array",
+ "items": {
+ "$ref": "messages.MessageHeader"
+ },
+ "description": "The saved message(s). The number of saved messages depends on the applied file carbon copy configuration (fcc)."
+ }
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getComposeState",
+ "type": "function",
+ "description": "Returns information about the current state of the message composer.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "tabId",
+ "type": "integer"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "return",
+ "$ref": "ComposeState"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/comm/mail/components/extensions/schemas/composeAction.json b/comm/mail/components/extensions/schemas/composeAction.json
new file mode 100644
index 0000000000..4220d8d6f1
--- /dev/null
+++ b/comm/mail/components/extensions/schemas/composeAction.json
@@ -0,0 +1,722 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "WebExtensionManifest",
+ "properties": {
+ "compose_action": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "UnrecognizedProperty"
+ },
+ "properties": {
+ "default_label": {
+ "type": "string",
+ "description": "The label of the composeAction 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 composeAction button. This shows up in the tooltip and the label. Defaults to the add-on name.",
+ "optional": true,
+ "preprocess": "localize"
+ },
+ "default_icon": {
+ "$ref": "IconPath",
+ "description": "The paths to one or more icons for the composeAction 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 ``light`` icon is used on dark backgrounds and vice versa. **Note:** The default theme uses the ``default_icon`` 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 composeAction button. Ignored for action buttons with type <value>menu</value>.",
+ "preprocess": "localize"
+ },
+ "browser_style": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Enable browser styles. See the `MDN documentation on browser styles <|link-mdn-browser-styles|>`__ for more information.",
+ "default": false
+ },
+ "default_area": {
+ "description": "Defines the location the composeAction button will appear. The default location is <value>maintoolbar</value>.",
+ "type": "string",
+ "enum": ["maintoolbar", "formattoolbar"],
+ "optional": true
+ },
+ "type": {
+ "description": "Specifies the type of the button. Default type is <code>button</code>.",
+ "type": "string",
+ "enum": ["button", "menu"],
+ "optional": true,
+ "default": "button"
+ }
+ },
+ "optional": true
+ }
+ }
+ }
+ ]
+ },
+ {
+ "namespace": "composeAction",
+ "description": "Use a composeAction to put a button in the message composition toolbars. In addition to its icon, a composeAction button can also have a tooltip, a badge, and a popup.",
+ "permissions": ["manifest:compose_action"],
+ "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 <value>[255, 0, 0, 255]</value>.",
+ "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 |ImageData| object (for example, from a |Canvas| element)."
+ },
+ {
+ "id": "ImageDataDictionary",
+ "type": "object",
+ "description": "A <em>dictionary object</em> to specify multiple |ImageData| 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 |ImageData| object, and <em>name</em> its size. Example: <literalinclude>includes/ImageDataDictionary.json<lang>JavaScript</lang></literalinclude>See the `MDN documentation about choosing icon sizes <|link-mdn-icon-size|>`__ for more information on this.",
+ "patternProperties": {
+ "^[1-9]\\d*$": {
+ "$ref": "ImageDataType"
+ }
+ }
+ },
+ {
+ "id": "OnClickData",
+ "type": "object",
+ "description": "Information sent when a composeAction 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 composeAction 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 composeAction button should display as its label and when moused over. Cleared by setting it to <value>null</value> 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 composeAction 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",
+ "parameters": [
+ {
+ "name": "result",
+ "type": "string"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "setLabel",
+ "type": "function",
+ "description": "Sets the label of the composeAction 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 composeAction 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 <value>null</value>."
+ },
+ "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 composeAction button.",
+ "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 label is retrieved."
+ },
+ "windowId": {
+ "type": "integer",
+ "optional": true,
+ "minimum": -2,
+ "unsupported": true,
+ "description": "Will throw an error if used."
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "result",
+ "type": "string",
+ "optional": true
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "setIcon",
+ "type": "function",
+ "description": "Sets the icon for the composeAction button. Either the ``path`` or the ``imageData`` 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 composeAction button."
+ },
+ "path": {
+ "$ref": "manifest.IconPath",
+ "optional": true,
+ "description": "The paths to one or more icons for the composeAction 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 composeAction 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 <value>null</value> (action will use the popup value defined in the manifest)."
+ },
+ "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 composeAction 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",
+ "parameters": [
+ {
+ "name": "result",
+ "type": "string"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "setBadgeText",
+ "type": "function",
+ "description": "Sets the badge text for the composeAction 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 <value>null</value> 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 composeAction 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 label is retrieved."
+ },
+ "windowId": {
+ "type": "integer",
+ "optional": true,
+ "minimum": -2,
+ "unsupported": true,
+ "description": "Will throw an error if used."
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "result",
+ "type": "string"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "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 <value>null</value> or an empty string."
+ },
+ "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 composeAction 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 label is retrieved."
+ },
+ "windowId": {
+ "type": "integer",
+ "optional": true,
+ "minimum": -2,
+ "unsupported": true,
+ "description": "Will throw an error if used."
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "result",
+ "$ref": "ColorArray"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "enable",
+ "type": "function",
+ "description": "Enables the composeAction button for a specific tab (if a ``tabId`` 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, a composeAction 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 composeAction button."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "disable",
+ "type": "function",
+ "description": "Disables the composeAction button for a specific tab (if a ``tabId`` 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 composeAction button."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "isEnabled",
+ "type": "function",
+ "description": "Checks whether the composeAction 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 <value>menu</value>, 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 a composeAction button is clicked. This event will not fire if the composeAction has a popup. This is a user input event handler. For asynchronous listeners some `restrictions <|link-user-input-restrictions|>`__ apply.",
+ "parameters": [
+ {
+ "name": "tab",
+ "$ref": "tabs.Tab"
+ },
+ {
+ "name": "info",
+ "$ref": "OnClickData",
+ "optional": true
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/comm/mail/components/extensions/schemas/extensionScripts.json b/comm/mail/components/extensions/schemas/extensionScripts.json
new file mode 100644
index 0000000000..67a734b7fb
--- /dev/null
+++ b/comm/mail/components/extensions/schemas/extensionScripts.json
@@ -0,0 +1,133 @@
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, you can obtain one at http://mozilla.org/MPL/2.0/.
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "OptionalPermission",
+ "choices": [
+ {
+ "type": "string",
+ "enum": ["messagesModify", "sensitiveDataUpload"]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "namespace": "composeScripts",
+ "permissions": ["compose"],
+ "types": [
+ {
+ "id": "RegisteredComposeScriptOptions",
+ "type": "object",
+ "description": "Details of a compose script registered programmatically",
+ "properties": {
+ "css": {
+ "type": "array",
+ "optional": true,
+ "description": "The list of CSS files to inject",
+ "items": {
+ "$ref": "extensionTypes.ExtensionFileOrCode"
+ }
+ },
+ "js": {
+ "type": "array",
+ "optional": true,
+ "description": "The list of JavaScript files to inject",
+ "items": {
+ "$ref": "extensionTypes.ExtensionFileOrCode"
+ }
+ }
+ }
+ },
+ {
+ "id": "RegisteredComposeScript",
+ "type": "object",
+ "description": "An object that represents a compose script registered programmatically",
+ "functions": [
+ {
+ "name": "unregister",
+ "type": "function",
+ "description": "Unregister a compose script registered programmatically",
+ "async": true,
+ "parameters": []
+ }
+ ]
+ }
+ ],
+ "functions": [
+ {
+ "name": "register",
+ "type": "function",
+ "description": "Register a compose script programmatically",
+ "async": true,
+ "parameters": [
+ {
+ "name": "composeScriptOptions",
+ "$ref": "RegisteredComposeScriptOptions"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "namespace": "messageDisplayScripts",
+ "permissions": ["messagesModify"],
+ "types": [
+ {
+ "id": "RegisteredMessageDisplayScriptOptions",
+ "type": "object",
+ "description": "Details of a message display script registered programmatically",
+ "properties": {
+ "css": {
+ "type": "array",
+ "optional": true,
+ "description": "The list of CSS files to inject",
+ "items": {
+ "$ref": "extensionTypes.ExtensionFileOrCode"
+ }
+ },
+ "js": {
+ "type": "array",
+ "optional": true,
+ "description": "The list of JavaScript files to inject",
+ "items": {
+ "$ref": "extensionTypes.ExtensionFileOrCode"
+ }
+ }
+ }
+ },
+ {
+ "id": "RegisteredMessageDisplayScript",
+ "type": "object",
+ "description": "An object that represents a message display script registered programmatically",
+ "functions": [
+ {
+ "name": "unregister",
+ "type": "function",
+ "description": "Unregister a message display script registered programmatically",
+ "async": true,
+ "parameters": []
+ }
+ ]
+ }
+ ],
+ "functions": [
+ {
+ "name": "register",
+ "type": "function",
+ "description": "Register a message display script programmatically",
+ "async": true,
+ "parameters": [
+ {
+ "name": "messageDisplayScriptOptions",
+ "$ref": "RegisteredMessageDisplayScriptOptions"
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/comm/mail/components/extensions/schemas/folders.json b/comm/mail/components/extensions/schemas/folders.json
new file mode 100644
index 0000000000..307cbcf789
--- /dev/null
+++ b/comm/mail/components/extensions/schemas/folders.json
@@ -0,0 +1,408 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "OptionalPermission",
+ "choices": [
+ {
+ "type": "string",
+ "enum": ["accountsFolders"]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "namespace": "folders",
+ "permissions": ["accountsRead"],
+ "types": [
+ {
+ "id": "MailFolder",
+ "type": "object",
+ "description": "An object describing a mail folder, as returned for example by the :ref:`folders.getParentFolders` or :ref:`folders.getSubFolders` methods, or part of a :ref:`accounts.MailAccount` object, which is returned for example by the :ref:`accounts.list` and :ref:`accounts.get` methods. The ``subFolders`` property is only included if requested.",
+ "properties": {
+ "accountId": {
+ "type": "string",
+ "description": "The account this folder belongs to."
+ },
+ "name": {
+ "type": "string",
+ "optional": true,
+ "description": "The human-friendly name of this folder."
+ },
+ "path": {
+ "type": "string",
+ "description": "Path to this folder in the account. Although paths look predictable, never guess a folder's path, as there are a number of reasons why it may not be what you think it is. Use :ref:`folders.getParentFolders` or :ref:`folders.getSubFolders` to obtain hierarchy information."
+ },
+ "subFolders": {
+ "type": "array",
+ "description": "Subfolders are only included if requested. They will be returned in the same order as used in Thunderbird's folder pane.",
+ "items": {
+ "$ref": "MailFolder"
+ },
+ "optional": true
+ },
+ "type": {
+ "type": "string",
+ "optional": true,
+ "description": "The type of folder, for several common types.",
+ "enum": [
+ "inbox",
+ "drafts",
+ "sent",
+ "trash",
+ "templates",
+ "archives",
+ "junk",
+ "outbox"
+ ]
+ }
+ }
+ },
+ {
+ "id": "MailFolderInfo",
+ "type": "object",
+ "description": "An object containing additional information about a mail folder.",
+ "properties": {
+ "favorite": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether this folder is a favorite folder."
+ },
+ "totalMessageCount": {
+ "type": "integer",
+ "optional": true,
+ "description": "Number of messages in this folder."
+ },
+ "unreadMessageCount": {
+ "type": "integer",
+ "optional": true,
+ "description": "Number of unread messages in this folder."
+ }
+ }
+ }
+ ],
+ "functions": [
+ {
+ "name": "create",
+ "type": "function",
+ "permissions": ["accountsFolders"],
+ "description": "Creates a new subfolder in the specified folder or at the root of the specified account.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "parent",
+ "choices": [
+ {
+ "$ref": "folders.MailFolder"
+ },
+ {
+ "$ref": "accounts.MailAccount"
+ }
+ ]
+ },
+ {
+ "name": "childName",
+ "type": "string"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "$ref": "folders.MailFolder"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "rename",
+ "type": "function",
+ "permissions": ["accountsFolders"],
+ "description": "Renames a folder.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "folder",
+ "$ref": "folders.MailFolder"
+ },
+ {
+ "name": "newName",
+ "type": "string"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "$ref": "folders.MailFolder"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "move",
+ "type": "function",
+ "permissions": ["accountsFolders"],
+ "description": "Moves the given ``sourceFolder`` into the given ``destination``. Throws if the destination already contains a folder with the name of the source folder.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "sourceFolder",
+ "$ref": "folders.MailFolder"
+ },
+ {
+ "name": "destination",
+ "choices": [
+ {
+ "$ref": "folders.MailFolder"
+ },
+ {
+ "$ref": "accounts.MailAccount"
+ }
+ ]
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "$ref": "folders.MailFolder"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "copy",
+ "type": "function",
+ "permissions": ["accountsFolders"],
+ "description": "Copies the given ``sourceFolder`` into the given ``destination``. Throws if the destination already contains a folder with the name of the source folder.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "sourceFolder",
+ "$ref": "folders.MailFolder"
+ },
+ {
+ "name": "destination",
+ "choices": [
+ {
+ "$ref": "folders.MailFolder"
+ },
+ {
+ "$ref": "accounts.MailAccount"
+ }
+ ]
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "$ref": "folders.MailFolder"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "delete",
+ "permissions": ["accountsFolders", "messagesDelete"],
+ "type": "function",
+ "description": "Deletes a folder.",
+ "async": true,
+ "parameters": [
+ {
+ "name": "folder",
+ "$ref": "folders.MailFolder"
+ }
+ ]
+ },
+ {
+ "name": "getFolderInfo",
+ "type": "function",
+ "description": "Get additional information about a mail folder.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "folder",
+ "$ref": "folders.MailFolder"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "$ref": "folders.MailFolderInfo"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getParentFolders",
+ "type": "function",
+ "description": "Get all parent folders as a flat ordered array. The first array entry is the direct parent.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "folder",
+ "$ref": "folders.MailFolder"
+ },
+ {
+ "name": "includeSubFolders",
+ "description": "Specifies whether the returned :ref:`folders.MailFolder` object for each parent folder should include its nested subfolders . Defaults to <value>false</value>.",
+ "optional": true,
+ "default": false,
+ "type": "boolean"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "folders.MailFolder"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getSubFolders",
+ "type": "function",
+ "description": "Get the subfolders of the specified folder or account.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "folderOrAccount",
+ "choices": [
+ {
+ "$ref": "folders.MailFolder"
+ },
+ {
+ "$ref": "accounts.MailAccount"
+ }
+ ]
+ },
+ {
+ "name": "includeSubFolders",
+ "description": "Specifies whether the returned :ref:`folders.MailFolder` object for each direct subfolder should also include all its nested subfolders . Defaults to <value>true</value>.",
+ "optional": true,
+ "default": true,
+ "type": "boolean"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "folders.MailFolder"
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "events": [
+ {
+ "name": "onCreated",
+ "type": "function",
+ "description": "Fired when a folder has been created.",
+ "parameters": [
+ {
+ "name": "createdFolder",
+ "$ref": "folders.MailFolder"
+ }
+ ]
+ },
+ {
+ "name": "onRenamed",
+ "type": "function",
+ "description": "Fired when a folder has been renamed.",
+ "parameters": [
+ {
+ "name": "originalFolder",
+ "$ref": "folders.MailFolder"
+ },
+ {
+ "name": "renamedFolder",
+ "$ref": "folders.MailFolder"
+ }
+ ]
+ },
+ {
+ "name": "onMoved",
+ "type": "function",
+ "description": "Fired when a folder has been moved.",
+ "parameters": [
+ {
+ "name": "originalFolder",
+ "$ref": "folders.MailFolder"
+ },
+ {
+ "name": "movedFolder",
+ "$ref": "folders.MailFolder"
+ }
+ ]
+ },
+ {
+ "name": "onCopied",
+ "type": "function",
+ "description": "Fired when a folder has been copied.",
+ "parameters": [
+ {
+ "name": "originalFolder",
+ "$ref": "folders.MailFolder"
+ },
+ {
+ "name": "copiedFolder",
+ "$ref": "folders.MailFolder"
+ }
+ ]
+ },
+ {
+ "name": "onDeleted",
+ "type": "function",
+ "description": "Fired when a folder has been deleted.",
+ "parameters": [
+ {
+ "name": "deletedFolder",
+ "$ref": "folders.MailFolder"
+ }
+ ]
+ },
+ {
+ "name": "onFolderInfoChanged",
+ "type": "function",
+ "description": "Fired when certain information of a folder have changed. Bursts of message count changes are collapsed to a single event.",
+ "parameters": [
+ {
+ "name": "folder",
+ "$ref": "folders.MailFolder"
+ },
+ {
+ "name": "folderInfo",
+ "$ref": "folders.MailFolderInfo"
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/comm/mail/components/extensions/schemas/identities.json b/comm/mail/components/extensions/schemas/identities.json
new file mode 100644
index 0000000000..f22068abd8
--- /dev/null
+++ b/comm/mail/components/extensions/schemas/identities.json
@@ -0,0 +1,277 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "OptionalPermission",
+ "choices": [
+ {
+ "type": "string",
+ "enum": ["accountsIdentities"]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "namespace": "identities",
+ "permissions": ["accountsRead"],
+ "types": [
+ {
+ "id": "MailIdentity",
+ "type": "object",
+ "properties": {
+ "accountId": {
+ "type": "string",
+ "optional": true,
+ "description": "The id of the :ref:`accounts.MailAccount` this identity belongs to. The ``accountId`` property is read-only."
+ },
+ "composeHtml": {
+ "type": "boolean",
+ "optional": true,
+ "description": "If the identity uses HTML as the default compose format."
+ },
+ "email": {
+ "type": "string",
+ "optional": true,
+ "description": "The user's email address as used when messages are sent from this identity."
+ },
+ "id": {
+ "type": "string",
+ "optional": true,
+ "description": "A unique identifier for this identity. The ``id`` property is read-only."
+ },
+ "label": {
+ "type": "string",
+ "optional": true,
+ "description": "A user-defined label for this identity."
+ },
+ "name": {
+ "type": "string",
+ "optional": true,
+ "description": "The user's name as used when messages are sent from this identity."
+ },
+ "replyTo": {
+ "type": "string",
+ "optional": true,
+ "description": "The reply-to email address associated with this identity."
+ },
+ "organization": {
+ "type": "string",
+ "optional": true,
+ "description": "The organization associated with this identity."
+ },
+ "signature": {
+ "type": "string",
+ "optional": true,
+ "description": "The signature of the identity."
+ },
+ "signatureIsPlainText": {
+ "type": "boolean",
+ "optional": true,
+ "description": "If the signature should be interpreted as plain text or as HTML."
+ }
+ }
+ }
+ ],
+ "functions": [
+ {
+ "name": "list",
+ "type": "function",
+ "description": "Returns the identities of the specified account, or all identities if no account is specified. Do not expect the returned identities to be in any specific order. Use :ref:`identities.getDefault` to get the default identity of an account.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "accountId",
+ "type": "string",
+ "optional": true
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "identities.MailIdentity"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "get",
+ "type": "function",
+ "description": "Returns details of the requested identity, or <value>null</value> if it doesn't exist.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "identityId",
+ "type": "string"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "$ref": "identities.MailIdentity",
+ "optional": true
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "create",
+ "permissions": ["accountsIdentities"],
+ "type": "function",
+ "description": "Create a new identity in the specified account.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "accountId",
+ "type": "string"
+ },
+ {
+ "name": "details",
+ "$ref": "identities.MailIdentity"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "$ref": "identities.MailIdentity"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "delete",
+ "permissions": ["accountsIdentities"],
+ "type": "function",
+ "description": "Attempts to delete the requested identity. Default identities cannot be deleted.",
+ "async": true,
+ "parameters": [
+ {
+ "name": "identityId",
+ "type": "string"
+ }
+ ]
+ },
+ {
+ "name": "update",
+ "permissions": ["accountsIdentities"],
+ "type": "function",
+ "description": "Updates the details of an identity.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "identityId",
+ "type": "string"
+ },
+ {
+ "name": "details",
+ "$ref": "identities.MailIdentity"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "$ref": "identities.MailIdentity"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getDefault",
+ "type": "function",
+ "description": "Returns the default identity for the requested account, or <value>null</value> if it is not defined.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "accountId",
+ "type": "string"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "$ref": "identities.MailIdentity"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "setDefault",
+ "type": "function",
+ "description": "Sets the default identity for the requested account.",
+ "async": true,
+ "parameters": [
+ {
+ "name": "accountId",
+ "type": "string"
+ },
+ {
+ "name": "identityId",
+ "type": "string"
+ }
+ ]
+ }
+ ],
+ "events": [
+ {
+ "name": "onCreated",
+ "type": "function",
+ "description": "Fired when a new identity has been created and added to an account. The event also fires for default identities that are created when a new account is added.",
+ "parameters": [
+ {
+ "name": "identityId",
+ "type": "string"
+ },
+ {
+ "name": "identity",
+ "$ref": "MailIdentity"
+ }
+ ]
+ },
+ {
+ "name": "onDeleted",
+ "type": "function",
+ "description": "Fired when an identity has been removed from an account.",
+ "parameters": [
+ {
+ "name": "identityId",
+ "type": "string"
+ }
+ ]
+ },
+ {
+ "name": "onUpdated",
+ "type": "function",
+ "description": "Fired when one or more properties of an identity have been modified. The returned :ref:`identities.MailIdentity` includes only the changed values.",
+ "parameters": [
+ {
+ "name": "identityId",
+ "type": "string"
+ },
+ {
+ "name": "changedValues",
+ "$ref": "MailIdentity"
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/comm/mail/components/extensions/schemas/mailTabs.json b/comm/mail/components/extensions/schemas/mailTabs.json
new file mode 100644
index 0000000000..6346d614be
--- /dev/null
+++ b/comm/mail/components/extensions/schemas/mailTabs.json
@@ -0,0 +1,428 @@
+[
+ {
+ "namespace": "mailTabs",
+ "types": [
+ {
+ "id": "MailTab",
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "windowId": {
+ "type": "integer"
+ },
+ "active": {
+ "type": "boolean"
+ },
+ "sortType": {
+ "type": "string",
+ "description": "**Note:** ``sortType`` and ``sortOrder`` depend on each other, so both should be present, or neither.",
+ "optional": true,
+ "enum": [
+ "none",
+ "date",
+ "subject",
+ "author",
+ "id",
+ "thread",
+ "priority",
+ "status",
+ "size",
+ "flagged",
+ "unread",
+ "recipient",
+ "location",
+ "tags",
+ "junkStatus",
+ "attachments",
+ "account",
+ "custom",
+ "received",
+ "correspondent"
+ ]
+ },
+ "sortOrder": {
+ "type": "string",
+ "description": "**Note:** ``sortType`` and ``sortOrder`` depend on each other, so both should be present, or neither.",
+ "optional": true,
+ "enum": ["none", "ascending", "descending"]
+ },
+ "viewType": {
+ "type": "string",
+ "optional": true,
+ "enum": ["ungrouped", "groupedByThread", "groupedBySortType"]
+ },
+ "layout": {
+ "type": "string",
+ "enum": ["standard", "wide", "vertical"]
+ },
+ "folderPaneVisible": {
+ "type": "boolean",
+ "optional": true
+ },
+ "messagePaneVisible": {
+ "type": "boolean",
+ "optional": true
+ },
+ "displayedFolder": {
+ "$ref": "folders.MailFolder",
+ "optional": true,
+ "description": "The <permission>accountsRead</permission> permission is required for this property to be included."
+ }
+ }
+ },
+ {
+ "id": "QuickFilterTextDetail",
+ "type": "object",
+ "properties": {
+ "text": {
+ "type": "string",
+ "description": "String to match against the ``recipients``, ``author``, ``subject``, or ``body``."
+ },
+ "recipients": {
+ "type": "boolean",
+ "description": "Shows messages where ``text`` matches the recipients.",
+ "optional": true
+ },
+ "author": {
+ "type": "boolean",
+ "description": "Shows messages where ``text`` matches the author.",
+ "optional": true
+ },
+ "subject": {
+ "type": "boolean",
+ "description": "Shows messages where ``text`` matches the subject.",
+ "optional": true
+ },
+ "body": {
+ "type": "boolean",
+ "description": "Shows messages where ``text`` matches the message body.",
+ "optional": true
+ }
+ }
+ }
+ ],
+ "functions": [
+ {
+ "name": "query",
+ "type": "function",
+ "description": "Gets all mail tabs that have the specified properties, or all mail tabs if no properties are specified.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "queryInfo",
+ "optional": true,
+ "default": {},
+ "properties": {
+ "active": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the tabs are active in their windows."
+ },
+ "currentWindow": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the tabs are in the current window."
+ },
+ "lastFocusedWindow": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the tabs are in the last focused window."
+ },
+ "windowId": {
+ "type": "integer",
+ "optional": true,
+ "minimum": -2,
+ "description": "The ID of the parent window, or :ref:`windows.WINDOW_ID_CURRENT` for the current window."
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "MailTab"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "get",
+ "type": "function",
+ "description": "Get the properties of a mail tab.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "tabId",
+ "type": "integer",
+ "description": "ID of the requested mail tab. Throws if the requested tab is not a mail tab."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "$ref": "MailTab"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getCurrent",
+ "type": "function",
+ "description": "Get the properties of the active mail tab, if the active tab is a mail tab. Returns undefined otherwise.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "$ref": "MailTab",
+ "optional": true
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "update",
+ "type": "function",
+ "description": "Modifies the properties of a mail tab. Properties that are not specified in ``updateProperties`` are not modified.",
+ "async": true,
+ "parameters": [
+ {
+ "name": "tabId",
+ "type": "integer",
+ "description": "Defaults to the active tab of the current window.",
+ "optional": true,
+ "minimum": 1
+ },
+ {
+ "name": "updateProperties",
+ "type": "object",
+ "properties": {
+ "displayedFolder": {
+ "$ref": "folders.MailFolder",
+ "description": "Sets the folder displayed in the tab. The extension must have the <permission>accountsRead</permission> permission to do this. The previous message selection in the given folder will be restored.",
+ "optional": true
+ },
+ "sortType": {
+ "type": "string",
+ "description": "Sorts the list of messages. ``sortOrder`` must also be given.",
+ "optional": true,
+ "enum": [
+ "none",
+ "date",
+ "subject",
+ "author",
+ "id",
+ "thread",
+ "priority",
+ "status",
+ "size",
+ "flagged",
+ "unread",
+ "recipient",
+ "location",
+ "tags",
+ "junkStatus",
+ "attachments",
+ "account",
+ "custom",
+ "received",
+ "correspondent"
+ ]
+ },
+ "sortOrder": {
+ "type": "string",
+ "description": "Sorts the list of messages. ``sortType`` must also be given.",
+ "optional": true,
+ "enum": ["none", "ascending", "descending"]
+ },
+ "viewType": {
+ "type": "string",
+ "optional": true,
+ "enum": ["ungrouped", "groupedByThread", "groupedBySortType"]
+ },
+ "layout": {
+ "type": "string",
+ "description": "Sets the arrangement of the folder pane, message list pane, and message display pane. Note that setting this applies it to all mail tabs.",
+ "optional": true,
+ "enum": ["standard", "wide", "vertical"]
+ },
+ "folderPaneVisible": {
+ "type": "boolean",
+ "description": "Shows or hides the folder pane.",
+ "optional": true
+ },
+ "messagePaneVisible": {
+ "type": "boolean",
+ "description": "Shows or hides the message display pane.",
+ "optional": true
+ }
+ }
+ }
+ ]
+ },
+ {
+ "name": "getSelectedMessages",
+ "type": "function",
+ "description": "Lists the selected messages in the current folder.",
+ "permissions": ["messagesRead"],
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "tabId",
+ "type": "integer",
+ "description": "Defaults to the active tab of the current window.",
+ "optional": true,
+ "minimum": 1
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "$ref": "messages.MessageList"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "setSelectedMessages",
+ "type": "function",
+ "description": "Selects none, one or multiple messages.",
+ "permissions": ["messagesRead", "accountsRead"],
+ "async": true,
+ "parameters": [
+ {
+ "name": "tabId",
+ "type": "integer",
+ "description": "Defaults to the active tab of the current window.",
+ "optional": true,
+ "minimum": 1
+ },
+ {
+ "name": "messageIds",
+ "type": "array",
+ "description": "The IDs of the messages, which should be selected. The mailTab will switch to the folder of the selected messages. Throws if they belong to different folders. Array can be empty to deselect any currently selected message.",
+ "items": {
+ "type": "integer"
+ }
+ }
+ ]
+ },
+ {
+ "name": "setQuickFilter",
+ "type": "function",
+ "description": "Sets the Quick Filter user interface based on the options specified.",
+ "async": true,
+ "parameters": [
+ {
+ "name": "tabId",
+ "type": "integer",
+ "description": "Defaults to the active tab of the current window.",
+ "optional": true,
+ "minimum": 1
+ },
+ {
+ "name": "properties",
+ "type": "object",
+ "properties": {
+ "show": {
+ "type": "boolean",
+ "description": "Shows or hides the Quick Filter bar.",
+ "optional": true
+ },
+ "unread": {
+ "type": "boolean",
+ "description": "Shows only unread messages.",
+ "optional": true
+ },
+ "flagged": {
+ "type": "boolean",
+ "description": "Shows only flagged messages.",
+ "optional": true
+ },
+ "contact": {
+ "type": "boolean",
+ "description": "Shows only messages from people in the address book.",
+ "optional": true
+ },
+ "tags": {
+ "optional": true,
+ "choices": [
+ {
+ "type": "boolean"
+ },
+ {
+ "$ref": "messages.TagsDetail"
+ }
+ ],
+ "description": "Shows only messages with tags on them."
+ },
+ "attachment": {
+ "type": "boolean",
+ "description": "Shows only messages with attachments.",
+ "optional": true
+ },
+ "text": {
+ "$ref": "QuickFilterTextDetail",
+ "description": "Shows only messages matching the supplied text.",
+ "optional": true
+ }
+ }
+ }
+ ]
+ }
+ ],
+ "events": [
+ {
+ "name": "onDisplayedFolderChanged",
+ "type": "function",
+ "description": "Fired when the displayed folder changes in any mail tab.",
+ "permissions": ["accountsRead"],
+ "parameters": [
+ {
+ "name": "tab",
+ "$ref": "tabs.Tab"
+ },
+ {
+ "name": "displayedFolder",
+ "$ref": "folders.MailFolder"
+ }
+ ]
+ },
+ {
+ "name": "onSelectedMessagesChanged",
+ "type": "function",
+ "description": "Fired when the selected messages change in any mail tab.",
+ "permissions": ["messagesRead"],
+ "parameters": [
+ {
+ "name": "tab",
+ "$ref": "tabs.Tab"
+ },
+ {
+ "name": "selectedMessages",
+ "$ref": "messages.MessageList"
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/comm/mail/components/extensions/schemas/menus.json b/comm/mail/components/extensions/schemas/menus.json
new file mode 100644
index 0000000000..34167a87d8
--- /dev/null
+++ b/comm/mail/components/extensions/schemas/menus.json
@@ -0,0 +1,757 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "PermissionNoPrompt",
+ "choices": [
+ {
+ "type": "string",
+ "enum": ["menus"]
+ }
+ ]
+ },
+ {
+ "$extend": "OptionalPermissionNoPrompt",
+ "choices": [
+ {
+ "type": "string",
+ "enum": ["menus.overrideContext"]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "namespace": "menus",
+ "permissions": ["menus"],
+ "description": "The menus API allows to add items to Thunderbird's menus. You can choose what types of objects your context menu additions apply to, such as images, hyperlinks, and pages.",
+ "properties": {
+ "ACTION_MENU_TOP_LEVEL_LIMIT": {
+ "value": 6,
+ "description": "The maximum number of top level extension items that can be added to an extension action context menu. Any items beyond this limit will be ignored."
+ }
+ },
+ "types": [
+ {
+ "id": "ContextType",
+ "choices": [
+ {
+ "type": "string",
+ "enum": [
+ "all",
+ "all_message_attachments",
+ "audio",
+ "compose_action",
+ "compose_action_menu",
+ "compose_attachments",
+ "compose_body",
+ "editable",
+ "folder_pane",
+ "frame",
+ "image",
+ "link",
+ "message_attachments",
+ "message_display_action",
+ "message_display_action_menu",
+ "message_list",
+ "page",
+ "password",
+ "selection",
+ "tab",
+ "tools_menu",
+ "video"
+ ]
+ },
+ {
+ "type": "string",
+ "max_manifest_version": 2,
+ "enum": ["browser_action", "browser_action_menu"]
+ },
+ {
+ "type": "string",
+ "min_manifest_version": 3,
+ "enum": ["action", "action_menu"]
+ }
+ ],
+ "description": "The different contexts a menu can appear in. Specifying <value>all</value> is equivalent to the combination of all other contexts excluding <value>tab</value> and <value>tools_menu</value>. More information about each context can be found in the `Supported UI Elements <|link-ui-elements|>`__ article on developer.thunderbird.net."
+ },
+ {
+ "id": "ItemType",
+ "type": "string",
+ "enum": ["normal", "checkbox", "radio", "separator"],
+ "description": "The type of menu item."
+ },
+ {
+ "id": "OnShowData",
+ "type": "object",
+ "description": "Information sent when a context menu is being shown. Some properties are only included if the extension has host permission for the given context, for example :permission:`activeTab` for content tabs, :permission:`compose` for compose tabs and :permission:`messagesRead` for message display tabs.",
+ "properties": {
+ "menuIds": {
+ "description": "A list of IDs of the menu items that were shown.",
+ "type": "array",
+ "items": {
+ "choices": [
+ {
+ "type": "integer"
+ },
+ {
+ "type": "string"
+ }
+ ]
+ }
+ },
+ "contexts": {
+ "description": "A list of all contexts that apply to the menu.",
+ "type": "array",
+ "items": {
+ "$ref": "ContextType"
+ }
+ },
+ "editable": {
+ "type": "boolean",
+ "description": "A flag indicating whether the element is editable (text input, textarea, etc.)."
+ },
+ "mediaType": {
+ "type": "string",
+ "optional": true,
+ "description": "One of <value>image</value>, <value>video</value>, or <value>audio</value> if the context menu was activated on one of these types of elements."
+ },
+ "viewType": {
+ "$ref": "extension.ViewType",
+ "optional": true,
+ "description": "The type of view where the menu is shown. May be unset if the menu is not associated with a view."
+ },
+ "linkText": {
+ "type": "string",
+ "optional": true,
+ "description": "If the element is a link, the text of that link. **Note:** Host permission is required."
+ },
+ "linkUrl": {
+ "type": "string",
+ "optional": true,
+ "description": "If the element is a link, the URL it points to. **Note:** Host permission is required."
+ },
+ "srcUrl": {
+ "type": "string",
+ "description": "Will be present for elements with a <em>src</em> URL. **Note:** Host permission is required.",
+ "optional": true
+ },
+ "pageUrl": {
+ "type": "string",
+ "description": "The URL of the page where the menu item was clicked. This property is not set if the click occurred in a context where there is no current page, such as in a launcher context menu. **Note:** Host permission is required.",
+ "optional": true
+ },
+ "frameUrl": {
+ "type": "string",
+ "description": "The URL of the frame of the element where the context menu was clicked, if it was in a frame. **Note:** Host permission is required.",
+ "optional": true
+ },
+ "selectionText": {
+ "type": "string",
+ "description": "The text for the context selection, if any. **Note:** Host permission is required.",
+ "optional": true
+ },
+ "targetElementId": {
+ "type": "integer",
+ "optional": true,
+ "description": "An identifier of the clicked content element, if any. Use :ref:`menus.getTargetElement` in the page to find the corresponding element."
+ },
+ "fieldId": {
+ "type": "string",
+ "optional": true,
+ "description": "An identifier of the clicked Thunderbird UI element, if any.",
+ "enum": [
+ "composeSubject",
+ "composeTo",
+ "composeCc",
+ "composeBcc",
+ "composeReplyTo",
+ "composeNewsgroupTo"
+ ]
+ },
+ "selectedMessages": {
+ "$ref": "messages.MessageList",
+ "optional": true,
+ "description": "The selected messages, if the context menu was opened in the message list. The <permission>messagesRead</permission> permission is required."
+ },
+ "displayedFolder": {
+ "$ref": "folders.MailFolder",
+ "optional": true,
+ "description": "The displayed folder, if the context menu was opened in the message list. The <permission>accountsRead</permission> permission is required."
+ },
+ "selectedFolder": {
+ "$ref": "folders.MailFolder",
+ "optional": true,
+ "description": "The selected folder, if the context menu was opened in the folder pane. The <permission>accountsRead</permission> permission is required."
+ },
+ "selectedAccount": {
+ "$ref": "accounts.MailAccount",
+ "optional": true,
+ "description": "The selected account, if the context menu was opened on an account entry in the folder pane. The <permission>accountsRead</permission> permission is required."
+ },
+ "attachments": {
+ "type": "array",
+ "optional": true,
+ "description": "The selected attachments. The <permission>compose</permission> permission is required to return attachments of a message being composed. The <permission>messagesRead</permission> permission is required to return attachments of displayed messages.",
+ "items": {
+ "choices": [
+ {
+ "$ref": "compose.ComposeAttachment"
+ },
+ {
+ "$ref": "messages.MessageAttachment"
+ }
+ ]
+ }
+ }
+ }
+ },
+ {
+ "id": "OnClickData",
+ "type": "object",
+ "description": "Information sent when a context menu item is clicked.",
+ "properties": {
+ "menuItemId": {
+ "choices": [
+ {
+ "type": "integer"
+ },
+ {
+ "type": "string"
+ }
+ ],
+ "description": "The ID of the menu item that was clicked."
+ },
+ "parentMenuItemId": {
+ "choices": [
+ {
+ "type": "integer"
+ },
+ {
+ "type": "string"
+ }
+ ],
+ "optional": true,
+ "description": "The parent ID, if any, for the item clicked."
+ },
+ "editable": {
+ "type": "boolean",
+ "description": "A flag indicating whether the element is editable (text input, textarea, etc.)."
+ },
+ "mediaType": {
+ "type": "string",
+ "optional": true,
+ "description": "One of <value>image</value>, <value>video</value>, or <value>audio</value> if the context menu was activated on one of these types of elements."
+ },
+ "viewType": {
+ "$ref": "extension.ViewType",
+ "optional": true,
+ "description": "The type of view where the menu is clicked. May be unset if the menu is not associated with a view."
+ },
+ "linkText": {
+ "type": "string",
+ "optional": true,
+ "description": "If the element is a link, the text of that link."
+ },
+ "linkUrl": {
+ "type": "string",
+ "optional": true,
+ "description": "If the element is a link, the URL it points to."
+ },
+ "srcUrl": {
+ "type": "string",
+ "optional": true,
+ "description": "Will be present for elements with a <em>src</em> URL."
+ },
+ "pageUrl": {
+ "type": "string",
+ "optional": true,
+ "description": "The URL of the page where the menu item was clicked. This property is not set if the click occurred in a context where there is no current page, such as in a launcher context menu."
+ },
+ "frameId": {
+ "type": "integer",
+ "optional": true,
+ "minimum": 0,
+ "description": "The id of the frame of the element where the context menu was clicked."
+ },
+ "frameUrl": {
+ "type": "string",
+ "optional": true,
+ "description": "The URL of the frame of the element where the context menu was clicked, if it was in a frame."
+ },
+ "selectionText": {
+ "type": "string",
+ "optional": true,
+ "description": "The text for the context selection, if any."
+ },
+ "wasChecked": {
+ "type": "boolean",
+ "optional": true,
+ "description": "A flag indicating the state of a checkbox or radio item before it was clicked."
+ },
+ "checked": {
+ "type": "boolean",
+ "optional": true,
+ "description": "A flag indicating the state of a checkbox or radio item after it is clicked."
+ },
+ "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."
+ },
+ "targetElementId": {
+ "type": "integer",
+ "optional": true,
+ "description": "An identifier of the clicked content element, if any. Use :ref:`menus.getTargetElement` in the page to find the corresponding element."
+ },
+ "fieldId": {
+ "type": "string",
+ "optional": true,
+ "description": "An identifier of the clicked Thunderbird UI element, if any.",
+ "enum": [
+ "composeSubject",
+ "composeTo",
+ "composeCc",
+ "composeBcc",
+ "composeReplyTo",
+ "composeNewsgroupTo"
+ ]
+ },
+ "selectedMessages": {
+ "$ref": "messages.MessageList",
+ "optional": true,
+ "description": "The selected messages, if the context menu was opened in the message list. The <permission>messagesRead</permission> permission is required."
+ },
+ "displayedFolder": {
+ "$ref": "folders.MailFolder",
+ "optional": true,
+ "description": "The displayed folder, if the context menu was opened in the message list. The <permission>accountsRead</permission> permission is required."
+ },
+ "selectedFolder": {
+ "$ref": "folders.MailFolder",
+ "optional": true,
+ "description": "The selected folder, if the context menu was opened in the folder pane. The <permission>accountsRead</permission> permission is required."
+ },
+ "selectedAccount": {
+ "$ref": "accounts.MailAccount",
+ "optional": true,
+ "description": "The selected account, if the context menu was opened on an account entry in the folder pane. The <permission>accountsRead</permission> permission is required."
+ },
+ "attachments": {
+ "type": "array",
+ "optional": true,
+ "description": "The selected attachments. The <permission>compose</permission> permission is required to return attachments of a message being composed. The <permission>messagesRead</permission> permission is required to return attachments of displayed messages.",
+ "items": {
+ "choices": [
+ {
+ "$ref": "compose.ComposeAttachment"
+ },
+ {
+ "$ref": "messages.MessageAttachment"
+ }
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "functions": [
+ {
+ "name": "create",
+ "type": "function",
+ "description": "Creates a new context menu item. Note that if an error occurs during creation, you may not find out until the creation callback fires (the details will be in `runtime.lastError <|link-runtime-last-error|>`__).",
+ "returns": {
+ "choices": [
+ {
+ "type": "integer"
+ },
+ {
+ "type": "string"
+ }
+ ],
+ "description": "The ID of the newly created item."
+ },
+ "parameters": [
+ {
+ "type": "object",
+ "name": "createProperties",
+ "properties": {
+ "type": {
+ "$ref": "ItemType",
+ "optional": true,
+ "description": "The type of menu item. Defaults to <value>normal</value> if not specified."
+ },
+ "id": {
+ "type": "string",
+ "optional": true,
+ "description": "The unique ID to assign to this item. Mandatory for event pages. Cannot be the same as another ID for this extension."
+ },
+ "icons": {
+ "$ref": "manifest.IconPath",
+ "optional": true,
+ "description": "Custom icons to display next to the menu item. Custom icons can only be set for items appearing in submenus."
+ },
+ "title": {
+ "type": "string",
+ "optional": true,
+ "description": "The text to be displayed in the item; this is <em>required</em> unless ``type`` is <value>separator</value>. When the context is <value>selection</value>, you can use <value>%s</value> within the string to show the selected text. For example, if this parameter's value is <value>Translate '%s' to Latin</value> and the user selects the word <value>cool</value>, the context menu item for the selection is <value>Translate 'cool' to Latin</value>. To specify an access key for the new menu entry, include a <value>&</value> before the desired letter in the title. For example <value>&Help</value>."
+ },
+ "checked": {
+ "type": "boolean",
+ "optional": true,
+ "description": "The initial state of a checkbox or radio item: <value>true</value> for selected and <value>false</value> for unselected. Only one radio item can be selected at a time in a given group of radio items."
+ },
+ "contexts": {
+ "type": "array",
+ "items": {
+ "$ref": "ContextType"
+ },
+ "minItems": 1,
+ "optional": true,
+ "description": "List of contexts this menu item will appear in. Defaults to <value>['page']</value> if not specified."
+ },
+ "viewTypes": {
+ "type": "array",
+ "items": {
+ "$ref": "extension.ViewType"
+ },
+ "minItems": 1,
+ "optional": true,
+ "description": "List of view types where the menu item will be shown. Defaults to any view, including those without a viewType."
+ },
+ "visible": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the item is visible in the menu."
+ },
+ "onclick": {
+ "type": "function",
+ "optional": true,
+ "description": "A function that will be called back when the menu item is clicked. Event pages cannot use this.",
+ "parameters": [
+ {
+ "name": "info",
+ "$ref": "OnClickData",
+ "description": "Information about the item clicked and the context where the click happened."
+ },
+ {
+ "name": "tab",
+ "$ref": "tabs.Tab",
+ "description": "The details of the tab where the click took place."
+ }
+ ]
+ },
+ "parentId": {
+ "choices": [
+ {
+ "type": "integer"
+ },
+ {
+ "type": "string"
+ }
+ ],
+ "optional": true,
+ "description": "The ID of a parent menu item; this makes the item a child of a previously added item."
+ },
+ "documentUrlPatterns": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "optional": true,
+ "description": "Lets you restrict the item to apply only to documents whose URL matches one of the given patterns. (This applies to frames as well.) For details on the format of a pattern, see `Match Patterns <|link-match-patterns|>`__."
+ },
+ "targetUrlPatterns": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "optional": true,
+ "description": "Similar to documentUrlPatterns, but lets you filter based on the src attribute of img/audio/video tags and the href of anchor tags."
+ },
+ "enabled": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether this context menu item is enabled or disabled. Defaults to true."
+ },
+ "command": {
+ "optional": true,
+ "choices": [
+ {
+ "type": "string",
+ "max_manifest_version": 2,
+ "description": "Specifies a command to issue for the context click. Currently supports internal commands <value>_execute_browser_action</value>, <value>_execute_compose_action</value> and <value>_execute_message_display_action</value>."
+ },
+ {
+ "type": "string",
+ "min_manifest_version": 3,
+ "description": "Specifies a command to issue for the context click. Currently supports internal commands <value>_execute_action</value>, <value>_execute_compose_action</value> and <value>_execute_message_display_action</value>."
+ }
+ ]
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "description": "Called when the item has been created in the browser. If there were any problems creating the item, details will be available in `runtime.lastError <|link-runtime-last-error|>`__.",
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "update",
+ "type": "function",
+ "description": "Updates a previously created context menu item.",
+ "async": "callback",
+ "parameters": [
+ {
+ "choices": [
+ {
+ "type": "integer"
+ },
+ {
+ "type": "string"
+ }
+ ],
+ "name": "id",
+ "description": "The ID of the item to update."
+ },
+ {
+ "type": "object",
+ "name": "updateProperties",
+ "description": "The properties to update. Accepts the same values as the create function.",
+ "properties": {
+ "type": {
+ "$ref": "ItemType",
+ "optional": true
+ },
+ "icons": {
+ "$ref": "manifest.IconPath",
+ "optional": "omit-key-if-missing"
+ },
+ "title": {
+ "type": "string",
+ "optional": true
+ },
+ "checked": {
+ "type": "boolean",
+ "optional": true
+ },
+ "contexts": {
+ "type": "array",
+ "items": {
+ "$ref": "ContextType"
+ },
+ "minItems": 1,
+ "optional": true
+ },
+ "viewTypes": {
+ "type": "array",
+ "items": {
+ "$ref": "extension.ViewType"
+ },
+ "minItems": 1,
+ "optional": true
+ },
+ "visible": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the item is visible in the menu."
+ },
+ "onclick": {
+ "type": "function",
+ "optional": "omit-key-if-missing",
+ "parameters": [
+ {
+ "name": "info",
+ "$ref": "OnClickData"
+ },
+ {
+ "name": "tab",
+ "$ref": "tabs.Tab",
+ "description": "The details of the tab where the click took place. **Note:** this parameter only present for extensions."
+ }
+ ]
+ },
+ "parentId": {
+ "choices": [
+ {
+ "type": "integer"
+ },
+ {
+ "type": "string"
+ }
+ ],
+ "optional": true,
+ "description": "**Note:** You cannot change an item to be a child of one of its own descendants."
+ },
+ "documentUrlPatterns": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "optional": true
+ },
+ "targetUrlPatterns": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "optional": true
+ },
+ "enabled": {
+ "type": "boolean",
+ "optional": true
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [],
+ "description": "Called when the context menu has been updated."
+ }
+ ]
+ },
+ {
+ "name": "remove",
+ "type": "function",
+ "description": "Removes a context menu item.",
+ "async": "callback",
+ "parameters": [
+ {
+ "choices": [
+ {
+ "type": "integer"
+ },
+ {
+ "type": "string"
+ }
+ ],
+ "name": "menuItemId",
+ "description": "The ID of the context menu item to remove."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [],
+ "description": "Called when the context menu has been removed."
+ }
+ ]
+ },
+ {
+ "name": "removeAll",
+ "type": "function",
+ "description": "Removes all context menu items added by this extension.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [],
+ "description": "Called when removal is complete."
+ }
+ ]
+ },
+ {
+ "name": "overrideContext",
+ "permissions": ["menus.overrideContext"],
+ "type": "function",
+ "description": "Show the matching menu items from this extension instead of the default menu. This should be called during a `contextmenu <|link-contextmenu-event|>`__ event handler, and only applies to the menu that opens after this event.",
+ "parameters": [
+ {
+ "name": "contextOptions",
+ "type": "object",
+ "properties": {
+ "showDefaults": {
+ "type": "boolean",
+ "optional": true,
+ "default": false,
+ "description": "Whether to also include default menu items in the menu."
+ },
+ "context": {
+ "type": "string",
+ "enum": ["tab"],
+ "optional": true,
+ "description": "ContextType to override, to allow menu items from other extensions in the menu. Currently only <value>tab</value> is supported. ``contextOptions.showDefaults`` cannot be used with this option."
+ },
+ "tabId": {
+ "type": "integer",
+ "minimum": 0,
+ "optional": true,
+ "description": "Required when context is <value>tab</value>. Requires the <permission>tabs</permission> permission."
+ }
+ }
+ }
+ ]
+ },
+ {
+ "name": "refresh",
+ "type": "function",
+ "description": "Updates the extension items in the shown menu, including changes that have been made since the menu was shown. Has no effect if the menu is hidden. Rebuilding a shown menu is an expensive operation, only invoke this method when necessary.",
+ "async": true,
+ "parameters": []
+ }
+ ],
+ "events": [
+ {
+ "name": "onClicked",
+ "type": "function",
+ "description": "Fired when a context menu item is clicked. This is a user input event handler. For asynchronous listeners some `restrictions <|link-user-input-restrictions|>`__ apply.",
+ "parameters": [
+ {
+ "name": "info",
+ "$ref": "OnClickData",
+ "description": "Information about the item clicked and the context where the click happened."
+ },
+ {
+ "name": "tab",
+ "$ref": "tabs.Tab",
+ "description": "The details of the tab where the click took place. If the click did not take place in a tab, this parameter will be missing.",
+ "optional": true
+ }
+ ]
+ },
+ {
+ "name": "onShown",
+ "type": "function",
+ "description": "Fired when a menu is shown. The extension can add, modify or remove menu items and call :ref:`menus.refresh` to update the menu.",
+ "parameters": [
+ {
+ "name": "info",
+ "$ref": "OnShowData",
+ "description": "Information about the context of the menu action and the created menu items."
+ },
+ {
+ "name": "tab",
+ "$ref": "tabs.Tab",
+ "description": "The details of the tab where the menu was opened."
+ }
+ ]
+ },
+ {
+ "name": "onHidden",
+ "type": "function",
+ "description": "Fired when a menu is hidden. This event is only fired if onShown has fired before.",
+ "parameters": []
+ }
+ ]
+ }
+]
diff --git a/comm/mail/components/extensions/schemas/menus_child.json b/comm/mail/components/extensions/schemas/menus_child.json
new file mode 100644
index 0000000000..9bcbbcc7d3
--- /dev/null
+++ b/comm/mail/components/extensions/schemas/menus_child.json
@@ -0,0 +1,31 @@
+[
+ {
+ "namespace": "menus",
+ "permissions": ["menus"],
+ "allowedContexts": ["content", "devtools"],
+ "description": "The part of the menus API that is available in all extension contexts, including content scripts.",
+ "functions": [
+ {
+ "name": "getTargetElement",
+ "type": "function",
+ "allowedContexts": ["content", "devtools"],
+ "description": "Retrieve the element that was associated with a recent `contextmenu <|link-contextmenu-event|>`__ event.",
+ "parameters": [
+ {
+ "type": "integer",
+ "description": "The identifier of the clicked element, available as ``info.targetElementId`` in the :ref:`menus.onShown` and :ref:`menus.onClicked` events.",
+ "name": "targetElementId"
+ }
+ ],
+ "returns": {
+ "type": "object",
+ "optional": true,
+ "isInstanceOf": "Element",
+ "additionalProperties": {
+ "type": "any"
+ }
+ }
+ }
+ ]
+ }
+]
diff --git a/comm/mail/components/extensions/schemas/messageDisplay.json b/comm/mail/components/extensions/schemas/messageDisplay.json
new file mode 100644
index 0000000000..f7e3d4ae6d
--- /dev/null
+++ b/comm/mail/components/extensions/schemas/messageDisplay.json
@@ -0,0 +1,159 @@
+[
+ {
+ "namespace": "messageDisplay",
+ "permissions": ["messagesRead"],
+ "events": [
+ {
+ "name": "onMessageDisplayed",
+ "type": "function",
+ "description": "Fired when a message is displayed, whether in a 3-pane tab, a message tab, or a message window.",
+ "parameters": [
+ {
+ "name": "tab",
+ "$ref": "tabs.Tab"
+ },
+ {
+ "name": "message",
+ "$ref": "messages.MessageHeader"
+ }
+ ]
+ },
+ {
+ "name": "onMessagesDisplayed",
+ "type": "function",
+ "description": "Fired when either a single message is displayed or when multiple messages are displayed, whether in a 3-pane tab, a message tab, or a message window.",
+ "parameters": [
+ {
+ "name": "tab",
+ "$ref": "tabs.Tab"
+ },
+ {
+ "name": "messages",
+ "type": "array",
+ "items": {
+ "$ref": "messages.MessageHeader"
+ }
+ }
+ ]
+ }
+ ],
+ "functions": [
+ {
+ "name": "getDisplayedMessage",
+ "type": "function",
+ "description": "Gets the currently displayed message in the specified tab (even if the tab itself is currently not visible). It returns <value>null</value> if no messages are displayed, or if multiple messages are displayed.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "tabId",
+ "type": "integer",
+ "minimum": 1
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "choices": [
+ {
+ "$ref": "messages.MessageHeader"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getDisplayedMessages",
+ "type": "function",
+ "description": "Gets an array of the currently displayed messages in the specified tab (even if the tab itself is currently not visible). The array is empty if no messages are displayed.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "tabId",
+ "type": "integer",
+ "minimum": 1
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "messages.MessageHeader"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "open",
+ "type": "function",
+ "description": "Opens a message in a new tab or in a new window.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "openProperties",
+ "type": "object",
+ "description": "Settings for opening the message. Exactly one of messageId, headerMessageId or file must be specified.",
+ "properties": {
+ "file": {
+ "type": "object",
+ "optional": true,
+ "isInstanceOf": "File",
+ "additionalProperties": true,
+ "description": "The DOM file object of a message to be opened."
+ },
+ "messageId": {
+ "type": "integer",
+ "optional": true,
+ "minimum": 1,
+ "description": "The id of a message to be opened. Will throw an <em>ExtensionError</em>, if the provided ``messageId`` is unknown or invalid."
+ },
+ "headerMessageId": {
+ "type": "string",
+ "optional": true,
+ "description": "The headerMessageId of a message to be opened. Will throw an <em>ExtensionError</em>, if the provided ``headerMessageId`` is unknown or invalid. Not supported for external messages."
+ },
+ "location": {
+ "type": "string",
+ "enum": ["tab", "window"],
+ "optional": true,
+ "description": "Where to open the message. If not specified, the users preference is honoured."
+ },
+ "active": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the new tab should become the active tab in the window. Only applicable to messages opened in tabs."
+ },
+ "windowId": {
+ "type": "integer",
+ "minimum": -2,
+ "optional": true,
+ "description": "The id of the window, where the new tab should be created. Defaults to the current window. Only applicable to messages opened in tabs."
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "tab",
+ "$ref": "tabs.Tab"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/comm/mail/components/extensions/schemas/messageDisplayAction.json b/comm/mail/components/extensions/schemas/messageDisplayAction.json
new file mode 100644
index 0000000000..9beda1c68e
--- /dev/null
+++ b/comm/mail/components/extensions/schemas/messageDisplayAction.json
@@ -0,0 +1,721 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "WebExtensionManifest",
+ "properties": {
+ "message_display_action": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "UnrecognizedProperty"
+ },
+ "properties": {
+ "default_label": {
+ "type": "string",
+ "description": "The label of the messageDisplayAction 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 messageDisplayAction button. This shows up in the tooltip and the label. Defaults to the add-on name.",
+ "optional": true,
+ "preprocess": "localize"
+ },
+ "default_icon": {
+ "$ref": "IconPath",
+ "description": "The paths to one or more icons for the messageDisplayAction 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 ``light`` icon is used on dark backgrounds and vice versa. **Note:** The default theme uses the ``default_icon`` 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 messageDisplayAction button. Ignored for action buttons with type <value>menu</value>.",
+ "preprocess": "localize"
+ },
+ "browser_style": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Enable browser styles. See the `MDN documentation on browser styles <|link-mdn-browser-styles|>`__ for more information.",
+ "default": false
+ },
+ "default_area": {
+ "description": "Currently unused.",
+ "type": "string",
+ "optional": true
+ },
+ "type": {
+ "description": "Specifies the type of the button. Default type is <code>button</code>.",
+ "type": "string",
+ "enum": ["button", "menu"],
+ "optional": true,
+ "default": "button"
+ }
+ },
+ "optional": true
+ }
+ }
+ }
+ ]
+ },
+ {
+ "namespace": "messageDisplayAction",
+ "description": "Use a messageDisplayAction to put a button in the message display toolbar. In addition to its icon, a messageDisplayAction button can also have a tooltip, a badge, and a popup.",
+ "permissions": ["manifest:message_display_action"],
+ "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 <value>[255, 0, 0, 255]</value>.",
+ "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 |ImageData| object (for example, from a |Canvas| element)."
+ },
+ {
+ "id": "ImageDataDictionary",
+ "type": "object",
+ "description": "A <em>dictionary object</em> to specify multiple |ImageData| 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 |ImageData| object, and <em>name</em> its size. Example: <literalinclude>includes/ImageDataDictionary.json<lang>JavaScript</lang></literalinclude>See the `MDN documentation about choosing icon sizes <|link-mdn-icon-size|>`__ for more information on this.",
+ "patternProperties": {
+ "^[1-9]\\d*$": {
+ "$ref": "ImageDataType"
+ }
+ }
+ },
+ {
+ "id": "OnClickData",
+ "type": "object",
+ "description": "Information sent when a messageDisplayAction 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 messageDisplayAction 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 messageDisplayAction button should display as its label and when moused over. Cleared by setting it to <value>null</value> 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 messageDisplayAction 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",
+ "parameters": [
+ {
+ "name": "result",
+ "type": "string"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "setLabel",
+ "type": "function",
+ "description": "Sets the label of the messageDisplayAction 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 messageDisplayAction 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 <value>null</value>."
+ },
+ "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 messageDisplayAction button.",
+ "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 label is retrieved."
+ },
+ "windowId": {
+ "type": "integer",
+ "optional": true,
+ "minimum": -2,
+ "unsupported": true,
+ "description": "Will throw an error if used."
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "result",
+ "type": "string",
+ "optional": true
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "setIcon",
+ "type": "function",
+ "description": "Sets the icon for the messageDisplayAction button. Either the ``path`` or the ``imageData`` 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 composeAction button."
+ },
+ "path": {
+ "$ref": "manifest.IconPath",
+ "optional": true,
+ "description": "The paths to one or more icons for the messageDisplayAction 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 messageDisplayAction 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 <value>null</value> (action will use the popup value defined in the manifest)."
+ },
+ "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 messageDisplayAction 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",
+ "parameters": [
+ {
+ "name": "result",
+ "type": "string"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "setBadgeText",
+ "type": "function",
+ "description": "Sets the badge text for the messageDisplayAction 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 <value>null</value> 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 messageDisplayAction 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 label is retrieved."
+ },
+ "windowId": {
+ "type": "integer",
+ "optional": true,
+ "minimum": -2,
+ "unsupported": true,
+ "description": "Will throw an error if used."
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "result",
+ "type": "string"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "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 <value>null</value> or an empty string."
+ },
+ "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 messageDisplayAction 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 label is retrieved."
+ },
+ "windowId": {
+ "type": "integer",
+ "optional": true,
+ "minimum": -2,
+ "unsupported": true,
+ "description": "Will throw an error if used."
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "result",
+ "$ref": "ColorArray"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "enable",
+ "type": "function",
+ "description": "Enables the messageDisplayAction button for a specific tab (if a ``tabId`` 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, a messageDisplayAction 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 messageDisplayAction button."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "disable",
+ "type": "function",
+ "description": "Disables the messageDisplayAction button for a specific tab (if a ``tabId`` 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 messageDisplayAction button."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "isEnabled",
+ "type": "function",
+ "description": "Checks whether the messageDisplayAction 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 <value>menu</value>, 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 a messageDisplayAction button is clicked. This event will not fire if the messageDisplayAction has a popup. This is a user input event handler. For asynchronous listeners some `restrictions <|link-user-input-restrictions|>`__ apply.",
+ "parameters": [
+ {
+ "name": "tab",
+ "$ref": "tabs.Tab"
+ },
+ {
+ "name": "info",
+ "$ref": "OnClickData",
+ "optional": true
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/comm/mail/components/extensions/schemas/messages.json b/comm/mail/components/extensions/schemas/messages.json
new file mode 100644
index 0000000000..6a025763a1
--- /dev/null
+++ b/comm/mail/components/extensions/schemas/messages.json
@@ -0,0 +1,933 @@
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "OptionalPermission",
+ "choices": [
+ {
+ "type": "string",
+ "enum": [
+ "messagesDelete",
+ "messagesImport",
+ "messagesMove",
+ "messagesRead",
+ "messagesTags",
+ "sensitiveDataUpload"
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "namespace": "messages",
+ "permissions": ["messagesRead"],
+ "types": [
+ {
+ "id": "MessageHeader",
+ "type": "object",
+ "description": "Basic information about a message.",
+ "properties": {
+ "author": {
+ "type": "string"
+ },
+ "bccList": {
+ "description": "The Bcc recipients. Not populated for news/nntp messages.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "ccList": {
+ "description": "The Cc recipients. Not populated for news/nntp messages.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "date": {
+ "$ref": "extensionTypes.Date"
+ },
+ "external": {
+ "type": "boolean",
+ "description": "Whether this message is a real message or an external message (opened from a file or from an attachment)."
+ },
+ "flagged": {
+ "type": "boolean",
+ "description": "Whether this message is flagged (a.k.a. starred)."
+ },
+ "folder": {
+ "$ref": "folders.MailFolder",
+ "description": "The <permission>accountsRead</permission> permission is required for this property to be included. Not available for external or attached messages.",
+ "optional": true
+ },
+ "headerMessageId": {
+ "type": "string",
+ "description": "The message-id header of the message."
+ },
+ "headersOnly": {
+ "description": "Some account types (for example <value>pop3</value>) allow to download only the headers of the message, but not its body. The body of such messages will not be available.",
+ "type": "boolean"
+ },
+ "id": {
+ "type": "integer",
+ "minimum": 1
+ },
+ "junk": {
+ "description": "Whether the message has been marked as junk. Always <value>false</value> for news/nntp messages and external messages.",
+ "type": "boolean"
+ },
+ "junkScore": {
+ "type": "integer",
+ "description": "The junk score associated with the message. Always <value>0</value> for news/nntp messages and external messages.",
+ "minimum": 0,
+ "maximum": 100
+ },
+ "read": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the message has been marked as read. Not available for external or attached messages."
+ },
+ "new": {
+ "type": "boolean",
+ "description": "Whether the message has been received recently and is marked as new."
+ },
+ "recipients": {
+ "description": "The To recipients. Not populated for news/nntp messages.",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "size": {
+ "description": "The total size of the message in bytes.",
+ "type": "integer"
+ },
+ "subject": {
+ "type": "string",
+ "description": "The subject of the message."
+ },
+ "tags": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Tags associated with this message. For a list of available tags, call the listTags method."
+ }
+ }
+ },
+ {
+ "id": "MessageList",
+ "type": "object",
+ "description": "See :doc:`how-to/messageLists` for more information.",
+ "properties": {
+ "id": {
+ "type": "string",
+ "optional": true
+ },
+ "messages": {
+ "type": "array",
+ "items": {
+ "$ref": "MessageHeader"
+ }
+ }
+ }
+ },
+ {
+ "id": "MessagePart",
+ "type": "object",
+ "description": "Represents an email message \"part\", which could be the whole message",
+ "properties": {
+ "body": {
+ "type": "string",
+ "description": "The content of the part",
+ "optional": true
+ },
+ "contentType": {
+ "type": "string",
+ "optional": true
+ },
+ "headers": {
+ "type": "object",
+ "description": "A <em>dictionary object</em> of part headers as <em>key-value</em> pairs, with the header name as <em>key</em>, and an array of headers as <em>value</em>",
+ "optional": true,
+ "additionalProperties": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the part, if it is a file",
+ "optional": true
+ },
+ "partName": {
+ "type": "string",
+ "optional": true,
+ "description": "The identifier of this part, used in :ref:`messages.getAttachmentFile`"
+ },
+ "parts": {
+ "type": "array",
+ "items": {
+ "$ref": "MessagePart"
+ },
+ "description": "Any sub-parts of this part",
+ "optional": true
+ },
+ "size": {
+ "type": "integer",
+ "optional": true,
+ "description": "The size of this part. The size of <em>message/*</em> parts is not the actual message size (on disc), but the total size of its decoded body parts, excluding headers."
+ }
+ }
+ },
+ {
+ "id": "MessageProperties",
+ "type": "object",
+ "description": "Message properties used in :ref:`messages.update` and :ref:`messages.import`. They can also be monitored by :ref:`messages.onUpdated`.",
+ "properties": {
+ "flagged": {
+ "type": "boolean",
+ "description": "Whether the message is flagged (a.k.a starred).",
+ "optional": true
+ },
+ "junk": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the message is marked as junk. Only supported in :ref:`messages.update`"
+ },
+ "new": {
+ "type": "boolean",
+ "description": "Whether the message is marked as new. Only supported in :ref:`messages.import`",
+ "optional": true
+ },
+ "read": {
+ "type": "boolean",
+ "description": "Whether the message is marked as read.",
+ "optional": true
+ },
+ "tags": {
+ "type": "array",
+ "description": "Tags associated with this message. For a list of available tags, call the listTags method.",
+ "optional": true,
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": "MessageTag",
+ "type": "object",
+ "properties": {
+ "key": {
+ "type": "string",
+ "description": "Unique tag identifier."
+ },
+ "tag": {
+ "type": "string",
+ "description": "Human-readable tag name."
+ },
+ "color": {
+ "type": "string",
+ "description": "Tag color."
+ },
+ "ordinal": {
+ "type": "string",
+ "description": "Custom sort string (usually empty)."
+ }
+ }
+ },
+ {
+ "id": "TagsDetail",
+ "type": "object",
+ "description": "Used for filtering messages by tag in various methods. Note that functions using this type may have a partial implementation.",
+ "properties": {
+ "tags": {
+ "type": "object",
+ "description": "A <em>dictionary object</em> with one or more filter condition as <em>key-value</em> pairs, the <em>key</em> being the tag to filter on, and the <em>value</em> being a boolean expression, requesting whether a message must include (<value>true</value>) or exclude (<value>false</value>) the tag. For a list of available tags, call the :ref:`messages.listTags` method.",
+ "patternProperties": {
+ ".*": {
+ "type": "boolean"
+ }
+ }
+ },
+ "mode": {
+ "type": "string",
+ "description": "Whether all of the tag filters must apply, or any of them.",
+ "enum": ["all", "any"]
+ }
+ }
+ },
+ {
+ "id": "MessageAttachment",
+ "type": "object",
+ "description": "Represents an attachment in a message.",
+ "properties": {
+ "contentType": {
+ "type": "string",
+ "description": "The content type of the attachment."
+ },
+ "name": {
+ "type": "string",
+ "description": "The name, as displayed to the user, of this attachment. This is usually but not always the filename of the attached file."
+ },
+ "partName": {
+ "type": "string",
+ "description": "Identifies the MIME part of the message associated with this attachment."
+ },
+ "size": {
+ "type": "integer",
+ "description": "The size in bytes of this attachment."
+ },
+ "message": {
+ "$ref": "messages.MessageHeader",
+ "optional": true,
+ "description": "A MessageHeader, if this attachment is a message."
+ }
+ }
+ }
+ ],
+ "events": [
+ {
+ "name": "onUpdated",
+ "type": "function",
+ "description": "Fired when one or more properties of a message have been updated.",
+ "parameters": [
+ {
+ "name": "message",
+ "$ref": "messages.MessageHeader"
+ },
+ {
+ "name": "changedProperties",
+ "$ref": "messages.MessageProperties"
+ }
+ ]
+ },
+ {
+ "name": "onMoved",
+ "type": "function",
+ "description": "Fired when messages have been moved.",
+ "permissions": ["accountsRead"],
+ "parameters": [
+ {
+ "name": "originalMessages",
+ "$ref": "messages.MessageList"
+ },
+ {
+ "name": "movedMessages",
+ "$ref": "messages.MessageList"
+ }
+ ]
+ },
+ {
+ "name": "onCopied",
+ "type": "function",
+ "description": "Fired when messages have been copied.",
+ "permissions": ["accountsRead"],
+ "parameters": [
+ {
+ "name": "originalMessages",
+ "$ref": "messages.MessageList"
+ },
+ {
+ "name": "copiedMessages",
+ "$ref": "messages.MessageList"
+ }
+ ]
+ },
+ {
+ "name": "onDeleted",
+ "type": "function",
+ "description": "Fired when messages have been permanently deleted.",
+ "permissions": ["accountsRead"],
+ "parameters": [
+ {
+ "name": "messages",
+ "$ref": "messages.MessageList"
+ }
+ ]
+ },
+ {
+ "name": "onNewMailReceived",
+ "type": "function",
+ "description": "Fired when a new message is received, and has been through junk classification and message filters.",
+ "permissions": ["accountsRead"],
+ "parameters": [
+ {
+ "name": "folder",
+ "$ref": "folders.MailFolder"
+ },
+ {
+ "name": "messages",
+ "$ref": "messages.MessageList"
+ }
+ ]
+ }
+ ],
+ "functions": [
+ {
+ "name": "list",
+ "type": "function",
+ "description": "Gets all messages in a folder.",
+ "async": "callback",
+ "permissions": ["accountsRead"],
+ "parameters": [
+ {
+ "name": "folder",
+ "$ref": "folders.MailFolder"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "$ref": "MessageList"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "continueList",
+ "type": "function",
+ "description": "Returns the next chunk of messages in a list. See :doc:`how-to/messageLists` for more information.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "messageListId",
+ "type": "string"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "$ref": "MessageList"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "get",
+ "type": "function",
+ "description": "Returns a specified message.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "messageId",
+ "type": "integer"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "$ref": "MessageHeader"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getFull",
+ "type": "function",
+ "description": "Returns a specified message, including all headers and MIME parts. Throws if the message could not be read, for example due to network issues.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "messageId",
+ "type": "integer"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "$ref": "MessagePart"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getRaw",
+ "type": "function",
+ "description": "Returns the unmodified source of a message. Throws if the message could not be read, for example due to network issues.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "messageId",
+ "type": "integer"
+ },
+ {
+ "name": "options",
+ "type": "object",
+ "properties": {
+ "data_format": {
+ "choices": [
+ {
+ "max_manifest_version": 2,
+ "description": "The message can either be returned as a DOM File or as a `binary string <|link-binary-string|>`__. The historic default is to return a binary string (kept for backward compatibility). However, it is now recommended to use the ``File`` format, because the DOM File object can be used as-is with the downloads API and has useful methods to access the content, like `File.text() <|link-DOMFile-text|>`__ and `File.arrayBuffer() <|link-DOMFile-arrayBuffer|>`__. Working with binary strings is error prone and needs special handling: <literalinclude>includes/messages/decodeBinaryString.js<lang>JavaScript</lang></literalinclude> (see MDN for `supported input encodings <|link-input-encoding|>`__).",
+ "type": "string",
+ "enum": ["File", "BinaryString"]
+ },
+ {
+ "min_manifest_version": 3,
+ "description": "The message can either be returned as a DOM File (default) or as a `binary string <|link-binary-string|>`__. It is recommended to use the ``File`` format, because the DOM File object can be used as-is with the downloads API and has useful methods to access the content, like `File.text() <|link-DOMFile-text|>`__ and `File.arrayBuffer() <|link-DOMFile-arrayBuffer|>`__. Working with binary strings is error prone and needs special handling: <literalinclude>includes/messages/decodeBinaryString.js<lang>JavaScript</lang></literalinclude> (see MDN for `supported input encodings <|link-input-encoding|>`__).",
+ "type": "string",
+ "enum": ["File", "BinaryString"]
+ }
+ ]
+ }
+ },
+ "optional": true
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "choices": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "object",
+ "isInstanceOf": "File",
+ "additionalProperties": true
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "listAttachments",
+ "type": "function",
+ "description": "Lists the attachments of a message.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "messageId",
+ "type": "integer"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "MessageAttachment"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getAttachmentFile",
+ "type": "function",
+ "description": "Gets the content of a :ref:`messages.MessageAttachment` as a |File| object.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "messageId",
+ "type": "integer"
+ },
+ {
+ "name": "partName",
+ "type": "string",
+ "pattern": "^\\d+(\\.\\d+)*$"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "type": "object",
+ "isInstanceOf": "File",
+ "additionalProperties": true
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "openAttachment",
+ "type": "function",
+ "description": "Opens the specified attachment",
+ "async": true,
+ "parameters": [
+ {
+ "name": "messageId",
+ "type": "integer"
+ },
+ {
+ "name": "partName",
+ "type": "string",
+ "pattern": "^\\d+(\\.\\d+)*$"
+ },
+ {
+ "name": "tabId",
+ "type": "integer",
+ "description": "The ID of the tab associated with the message opening."
+ }
+ ]
+ },
+ {
+ "name": "query",
+ "type": "function",
+ "description": "Gets all messages that have the specified properties, or all messages if no properties are specified.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "queryInfo",
+ "optional": true,
+ "default": {},
+ "properties": {
+ "attachment": {
+ "type": "boolean",
+ "optional": true,
+ "description": "If specified, returns only messages with or without attachments."
+ },
+ "author": {
+ "type": "string",
+ "optional": true,
+ "description": "Returns only messages with this value matching the author. The search value is a single email address, a name or a combination (e.g.: <value>Name <user@domain.org></value>). The address part of the search value (if provided) must match the author's address completely. The name part of the search value (if provided) must match the author's name partially. All matches are done case-insensitive."
+ },
+ "body": {
+ "type": "string",
+ "optional": true,
+ "description": "Returns only messages with this value in the body of the mail."
+ },
+ "flagged": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Returns only flagged (or unflagged if false) messages."
+ },
+ "folder": {
+ "$ref": "folders.MailFolder",
+ "optional": true,
+ "description": "Returns only messages from the specified folder. The <permission>accountsRead</permission> permission is required."
+ },
+ "fromDate": {
+ "$ref": "extensionTypes.Date",
+ "optional": true,
+ "description": "Returns only messages with a date after this value."
+ },
+ "fromMe": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Returns only messages with the author's address matching any configured identity."
+ },
+ "fullText": {
+ "type": "string",
+ "optional": true,
+ "description": "Returns only messages with this value somewhere in the mail (subject, body or author)."
+ },
+ "headerMessageId": {
+ "type": "string",
+ "optional": true,
+ "description": "Returns only messages with a Message-ID header matching this value."
+ },
+ "includeSubFolders": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Search the folder specified by ``queryInfo.folder`` recursively."
+ },
+ "recipients": {
+ "type": "string",
+ "optional": true,
+ "description": "Returns only messages whose recipients match all specified addresses. The search value is a semicolon separated list of email addresses, names or combinations (e.g.: <value>Name <user@domain.org></value>). For a match, all specified addresses must equal a recipient's address completely and all specified names must match a recipient's name partially. All matches are done case-insensitive."
+ },
+ "subject": {
+ "type": "string",
+ "optional": true,
+ "description": "Returns only messages with this value matching the subject."
+ },
+ "tags": {
+ "$ref": "TagsDetail",
+ "optional": true,
+ "description": "Returns only messages with the specified tags. For a list of available tags, call the :ref:`messages.listTags` method."
+ },
+ "toDate": {
+ "$ref": "extensionTypes.Date",
+ "optional": true,
+ "description": "Returns only messages with a date before this value."
+ },
+ "toMe": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Returns only messages with at least one recipient address matching any configured identity."
+ },
+ "unread": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Returns only unread (or read if false) messages."
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "$ref": "MessageList"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "update",
+ "type": "function",
+ "description": "Marks or unmarks a message as junk, read, flagged, or tagged. Updating external messages will throw an <em>ExtensionError</em>.",
+ "async": true,
+ "parameters": [
+ {
+ "name": "messageId",
+ "type": "integer",
+ "minimum": 1
+ },
+ {
+ "name": "newProperties",
+ "$ref": "MessageProperties"
+ }
+ ]
+ },
+ {
+ "name": "move",
+ "type": "function",
+ "description": "Moves messages to a specified folder. If the messages cannot be removed from the source folder, they will be copied instead of moved. Moving external messages will throw an <em>ExtensionError</em>.",
+ "async": true,
+ "permissions": ["accountsRead", "messagesMove"],
+ "parameters": [
+ {
+ "name": "messageIds",
+ "type": "array",
+ "description": "The IDs of the messages to move.",
+ "items": {
+ "type": "integer",
+ "minimum": 1
+ }
+ },
+ {
+ "name": "destination",
+ "$ref": "folders.MailFolder",
+ "description": "The folder to move the messages to."
+ }
+ ]
+ },
+ {
+ "name": "copy",
+ "type": "function",
+ "description": "Copies messages to a specified folder.",
+ "async": true,
+ "permissions": ["accountsRead", "messagesMove"],
+ "parameters": [
+ {
+ "name": "messageIds",
+ "type": "array",
+ "description": "The IDs of the messages to copy.",
+ "items": {
+ "type": "integer",
+ "minimum": 1
+ }
+ },
+ {
+ "name": "destination",
+ "$ref": "folders.MailFolder",
+ "description": "The folder to copy the messages to."
+ }
+ ]
+ },
+ {
+ "name": "delete",
+ "type": "function",
+ "description": "Deletes messages permanently, or moves them to the trash folder (honoring the account's deletion behavior settings). Deleting external messages will throw an <em>ExtensionError</em>. The ``skipTrash`` parameter allows immediate permanent deletion, bypassing the trash folder.\n**Note**: Consider using :ref:`messages.move` to manually move messages to the account's trash folder, instead of requesting the overly powerful permission to actually delete messages. The account's trash folder can be extracted as follows: <literalinclude>includes/messages/getTrash.js<lang>JavaScript</lang></literalinclude>",
+ "async": true,
+ "permissions": ["messagesDelete"],
+ "parameters": [
+ {
+ "name": "messageIds",
+ "type": "array",
+ "description": "The IDs of the messages to delete.",
+ "items": {
+ "type": "integer",
+ "minimum": 1
+ }
+ },
+ {
+ "name": "skipTrash",
+ "type": "boolean",
+ "description": "If true, the message will be deleted permanently, regardless of the account's deletion behavior settings.",
+ "optional": true
+ }
+ ]
+ },
+ {
+ "name": "import",
+ "type": "function",
+ "description": "Imports a message into a local Thunderbird folder. To import a message into an IMAP folder, add it to a local folder first and then move it to the IMAP folder.",
+ "async": "callback",
+ "permissions": ["accountsRead", "messagesImport"],
+ "parameters": [
+ {
+ "name": "file",
+ "type": "object",
+ "isInstanceOf": "File",
+ "additionalProperties": true
+ },
+ {
+ "name": "destination",
+ "$ref": "folders.MailFolder",
+ "description": "The folder to import the messages into."
+ },
+ {
+ "name": "properties",
+ "$ref": "messages.MessageProperties",
+ "optional": true
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "$ref": "messages.MessageHeader"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "archive",
+ "type": "function",
+ "description": "Archives messages using the current settings. Archiving external messages will throw an <em>ExtensionError</em>.",
+ "async": true,
+ "permissions": ["messagesMove"],
+ "parameters": [
+ {
+ "name": "messageIds",
+ "type": "array",
+ "description": "The IDs of the messages to archive.",
+ "items": {
+ "type": "integer",
+ "minimum": 1
+ }
+ }
+ ]
+ },
+ {
+ "name": "listTags",
+ "type": "function",
+ "description": "Returns a list of tags that can be set on messages, and their human-friendly name, colour, and sort order.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "MessageTag"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "createTag",
+ "type": "function",
+ "description": "Creates a new message tag. Tagging a message will store the tag's key in the user's message. Throws if the specified tag key is used already.",
+ "async": true,
+ "permissions": ["messagesTags"],
+ "parameters": [
+ {
+ "type": "string",
+ "name": "key",
+ "description": "Unique tag identifier (will be converted to lower case). Must not include <value>()<>{/%*\"</value> or spaces.",
+ "pattern": "^[^ ()/{%*<>\"]+$"
+ },
+ {
+ "type": "string",
+ "name": "tag",
+ "description": "Human-readable tag name."
+ },
+ {
+ "type": "string",
+ "name": "color",
+ "description": "Tag color in hex format (i.e.: #000080 for navy blue)",
+ "pattern": "^#[0-9a-f]{6}"
+ }
+ ]
+ },
+ {
+ "name": "updateTag",
+ "type": "function",
+ "description": "Updates a message tag.",
+ "async": true,
+ "permissions": ["messagesTags"],
+ "parameters": [
+ {
+ "type": "string",
+ "name": "key",
+ "description": "Unique tag identifier (will be converted to lower case). Must not include <value>()<>{/%*\"</value> or spaces.",
+ "pattern": "^[^ ()/{%*<>\"]+$"
+ },
+ {
+ "type": "object",
+ "name": "updateProperties",
+ "properties": {
+ "tag": {
+ "type": "string",
+ "optional": "true",
+ "description": "Human-readable tag name."
+ },
+ "color": {
+ "type": "string",
+ "pattern": "^#[0-9a-f]{6}",
+ "description": "Tag color in hex format (i.e.: #000080 for navy blue).",
+ "optional": "true"
+ }
+ }
+ }
+ ]
+ },
+ {
+ "name": "deleteTag",
+ "type": "function",
+ "description": "Deletes a message tag, removing it from the list of known tags. Its key will not be removed from tagged messages, but they will appear untagged. Recreating a deleted tag, will make all former tagged messages appear tagged again.",
+ "async": true,
+ "permissions": ["messagesTags"],
+ "parameters": [
+ {
+ "type": "string",
+ "name": "key",
+ "description": "Unique tag identifier (will be converted to lower case). Must not include <value>()<>{/%*\"</value> or spaces.",
+ "pattern": "^[^ ()/{%*<>\"]+$"
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/comm/mail/components/extensions/schemas/sessions.json b/comm/mail/components/extensions/schemas/sessions.json
new file mode 100644
index 0000000000..3c2fdff165
--- /dev/null
+++ b/comm/mail/components/extensions/schemas/sessions.json
@@ -0,0 +1,76 @@
+[
+ {
+ "namespace": "sessions",
+ "functions": [
+ {
+ "name": "setTabValue",
+ "type": "function",
+ "description": "Store a key/value pair associated with a given tab.",
+ "async": true,
+ "parameters": [
+ {
+ "name": "tabId",
+ "type": "integer",
+ "description": "ID of the tab with which you want to associate the data. Error is thrown if ID is invalid."
+ },
+ {
+ "name": "key",
+ "type": "string",
+ "description": "Key that you can later use to retrieve this particular data value."
+ },
+ {
+ "name": "value",
+ "type": "string"
+ }
+ ]
+ },
+ {
+ "name": "getTabValue",
+ "type": "function",
+ "description": "Retrieve a previously stored value for a given tab, given its key.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "tabId",
+ "type": "integer",
+ "description": "ID of the tab whose data you are trying to retrieve. Error is thrown if ID is invalid."
+ },
+ {
+ "name": "key",
+ "type": "string",
+ "description": "Key identifying the particular value to retrieve."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "type": "string",
+ "optional": true
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "removeTabValue",
+ "type": "function",
+ "description": "Remove a key/value pair from a given tab.",
+ "async": true,
+ "parameters": [
+ {
+ "name": "tabId",
+ "type": "integer",
+ "description": "ID of the tab whose data you are trying to remove. Error is thrown if ID is invalid."
+ },
+ {
+ "name": "key",
+ "type": "string",
+ "description": "Key identifying the particular value to remove."
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/comm/mail/components/extensions/schemas/spaces.json b/comm/mail/components/extensions/schemas/spaces.json
new file mode 100644
index 0000000000..e94731f810
--- /dev/null
+++ b/comm/mail/components/extensions/schemas/spaces.json
@@ -0,0 +1,290 @@
+[
+ {
+ "namespace": "spaces",
+ "types": [
+ {
+ "id": "SpaceButtonProperties",
+ "type": "object",
+ "properties": {
+ "badgeBackgroundColor": {
+ "choices": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "ColorArray"
+ }
+ ],
+ "optional": true,
+ "description": "Sets the background color of the badge. Can be specified as an array of four integers in the range [0,255] that make up the RGBA color of the badge. For example, opaque red is <value>[255, 0, 0, 255]</value>. Can also be a string with an HTML color name (<value>red</value>) or a HEX color value (<value>#FF0000</value> or <value>#F00</value>). Reset when set to an empty string."
+ },
+ "badgeText": {
+ "type": "string",
+ "optional": true,
+ "description": "Sets the badge text for the button in the spaces toolbar. The badge is displayed on top of the icon. Any number of characters can be set, but only about four can fit in the space. Removed when set to an empty string."
+ },
+ "defaultIcons": {
+ "choices": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "manifest.IconPath"
+ }
+ ],
+ "optional": true,
+ "description": "The paths to one or more icons for the button in the spaces toolbar. Defaults to the extension icon, if set to an empty string."
+ },
+ "themeIcons": {
+ "type": "array",
+ "optional": true,
+ "items": {
+ "$ref": "manifest.ThemeIcons"
+ },
+ "description": "Specifies dark and light icons for the button in the spaces toolbar to be used with themes: The ``light`` icons will be used on dark backgrounds and vice versa. At least the set for <em>16px</em> icons should be specified. The set for <em>32px</em> icons will be used on screens with a very high pixel density, if specified."
+ },
+ "title": {
+ "type": "string",
+ "optional": true,
+ "description": "The title for the button in the spaces toolbar, used in the tooltip of the button and as the displayed name in the overflow menu. Defaults to the name of the extension, if set to an empty string."
+ }
+ }
+ },
+ {
+ "id": "ColorArray",
+ "description": "An array of four integers in the range [0,255] that make up the RGBA color. For example, opaque red is <value>[255, 0, 0, 255]</value>.",
+ "type": "array",
+ "items": {
+ "type": "integer",
+ "minimum": 0,
+ "maximum": 255
+ },
+ "minItems": 4,
+ "maxItems": 4
+ },
+ {
+ "id": "Space",
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "The id of the space.",
+ "minimum": 1
+ },
+ "name": {
+ "type": "string",
+ "pattern": "^[a-zA-Z0-9_]+$",
+ "description": "The name of the space. Names are unique for a single extension, but different extensions may use the same name."
+ },
+ "isBuiltIn": {
+ "type": "boolean",
+ "description": "Whether this space is one of the default Thunderbird spaces, or an extension space."
+ },
+ "isSelfOwned": {
+ "type": "boolean",
+ "description": "Whether this space was created by this extension."
+ },
+ "extensionId": {
+ "type": "string",
+ "optional": true,
+ "description": "The id of the extension which owns the space. The <permission>management</permission> permission is required to include this property."
+ }
+ }
+ }
+ ],
+ "functions": [
+ {
+ "name": "create",
+ "type": "function",
+ "description": "Creates a new space and adds its button to the spaces toolbar.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "name",
+ "type": "string",
+ "pattern": "^[a-zA-Z0-9_]+$",
+ "description": "The name to assign to this space. May only contain alphanumeric characters and underscores. Must be unique for this extension."
+ },
+ {
+ "name": "defaultUrl",
+ "type": "string",
+ "description": "The default space url, loaded into a tab when the button in the spaces toolbar is clicked. Supported are <value>https://</value> and <value>http://</value> links, as well as links to WebExtension pages."
+ },
+ {
+ "name": "buttonProperties",
+ "description": "Properties of the button for the new space.",
+ "$ref": "spaces.SpaceButtonProperties",
+ "optional": true,
+ "default": {}
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "space",
+ "$ref": "spaces.Space"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "get",
+ "type": "function",
+ "description": "Retrieves details about the specified space.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "spaceId",
+ "type": "integer",
+ "description": "The id of the space.",
+ "minimum": 1
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "space",
+ "$ref": "spaces.Space"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "query",
+ "type": "function",
+ "description": "Gets all spaces that have the specified properties, or all spaces if no properties are specified.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "queryInfo",
+ "optional": true,
+ "default": {},
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "The id of the space.",
+ "optional": true,
+ "minimum": 1
+ },
+ "name": {
+ "type": "string",
+ "pattern": "^[a-zA-Z0-9_]+$",
+ "optional": true,
+ "description": "The name of the spaces (names are not unique)."
+ },
+ "isBuiltIn": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Spaces should be default Thunderbird spaces."
+ },
+ "isSelfOwned": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Spaces should have been created by this extension."
+ },
+ "extensionId": {
+ "type": "string",
+ "optional": true,
+ "description": "Id of the extension which should own the spaces. The <permission>management</permission> permission is required to be able to match against extension ids."
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "result",
+ "type": "array",
+ "items": {
+ "$ref": "spaces.Space"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "remove",
+ "type": "function",
+ "description": "Removes the specified space, closes all its tabs and removes its button from the spaces toolbar. Throws an exception if the requested space does not exist or was not created by this extension.",
+ "async": true,
+ "parameters": [
+ {
+ "name": "spaceId",
+ "type": "integer",
+ "description": "The id of the space.",
+ "minimum": 1
+ }
+ ]
+ },
+ {
+ "name": "update",
+ "type": "function",
+ "description": "Updates the specified space. Throws an exception if the requested space does not exist or was not created by this extension.",
+ "async": true,
+ "parameters": [
+ {
+ "name": "spaceId",
+ "type": "integer",
+ "description": "The id of the space.",
+ "minimum": 1
+ },
+ {
+ "name": "defaultUrl",
+ "type": "string",
+ "description": "The default space url, loaded into a tab when the button in the spaces toolbar is clicked. Supported are <value>https://</value> and <value>http://</value> links, as well as links to WebExtension pages.",
+ "optional": true
+ },
+ {
+ "name": "buttonProperties",
+ "description": "Only specified button properties will be updated.",
+ "$ref": "spaces.SpaceButtonProperties",
+ "optional": true
+ }
+ ]
+ },
+ {
+ "name": "open",
+ "type": "function",
+ "description": "Opens or switches to the specified space. Throws an exception if the requested space does not exist or was not created by this extension.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "spaceId",
+ "type": "integer",
+ "description": "The id of the space.",
+ "minimum": 1
+ },
+ {
+ "name": "windowId",
+ "type": "integer",
+ "minimum": -2,
+ "optional": true,
+ "description": "The id of the normal window, where the space should be opened. Defaults to the most recent normal window."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "tab",
+ "$ref": "tabs.Tab",
+ "optional": true,
+ "description": "Details about the opened or activated space tab."
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/comm/mail/components/extensions/schemas/spacesToolbar.json b/comm/mail/components/extensions/schemas/spacesToolbar.json
new file mode 100644
index 0000000000..50beab1367
--- /dev/null
+++ b/comm/mail/components/extensions/schemas/spacesToolbar.json
@@ -0,0 +1,175 @@
+[
+ {
+ "namespace": "spacesToolbar",
+ "max_manifest_version": 2,
+ "types": [
+ {
+ "id": "ButtonProperties",
+ "type": "object",
+ "properties": {
+ "badgeBackgroundColor": {
+ "choices": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "ColorArray"
+ }
+ ],
+ "optional": true,
+ "description": "Sets the background color of the badge. Can be specified as an array of four integers in the range [0,255] that make up the RGBA color of the badge. For example, opaque red is <value>[255, 0, 0, 255]</value>. Can also be a string with an HTML color name (<value>red</value>) or a HEX color value (<value>#FF0000</value> or <value>#F00</value>). Reset when set to an empty string."
+ },
+ "badgeText": {
+ "type": "string",
+ "optional": true,
+ "description": "Sets the badge text for the spaces toolbar button. The badge is displayed on top of the icon. Any number of characters can be set, but only about four can fit in the space. Removed when set to an empty string."
+ },
+ "defaultIcons": {
+ "choices": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "manifest.IconPath"
+ }
+ ],
+ "optional": true,
+ "description": "The paths to one or more icons for the button in the spaces toolbar. Defaults to the extension icon, if set to an empty string."
+ },
+ "themeIcons": {
+ "type": "array",
+ "optional": true,
+ "items": {
+ "$ref": "manifest.ThemeIcons"
+ },
+ "description": "Specifies dark and light icons for the spaces toolbar button to be used with themes: The ``light`` icons will be used on dark backgrounds and vice versa. At least the set for <em>16px</em> icons should be specified. The set for <em>32px</em> icons will be used on screens with a very high pixel density, if specified."
+ },
+ "title": {
+ "type": "string",
+ "optional": true,
+ "description": "The title for the spaces toolbar button, used in the tooltip of the button and as the displayed name in the overflow menu. Defaults to the name of the extension, if set to an empty string."
+ },
+ "url": {
+ "type": "string",
+ "optional": true,
+ "description": "The page url, loaded into a tab when the button is clicked. Supported are <value>https://</value> and <value>http://</value> links, as well as links to WebExtension pages."
+ }
+ }
+ },
+ {
+ "id": "ColorArray",
+ "description": "An array of four integers in the range [0,255] that make up the RGBA color. For example, opaque red is <value>[255, 0, 0, 255]</value>.",
+ "type": "array",
+ "items": {
+ "type": "integer",
+ "minimum": 0,
+ "maximum": 255
+ },
+ "minItems": 4,
+ "maxItems": 4
+ }
+ ],
+ "functions": [
+ {
+ "name": "addButton",
+ "type": "function",
+ "description": "Adds a new button to the spaces toolbar. Throws an exception, if the used ``id`` is not unique within the extension.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "id",
+ "type": "string",
+ "pattern": "^[a-zA-Z0-9_]+$",
+ "description": "The unique id to assign to this button. May only contain alphanumeric characters and underscores."
+ },
+ {
+ "name": "properties",
+ "description": "Properties of the new button. The ``url`` is mandatory.",
+ "$ref": "spacesToolbar.ButtonProperties"
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "spaceId",
+ "type": "integer",
+ "description": "The id of the space belonging to the newly created button, as used by the tabs API.",
+ "minimum": 1,
+ "optional": true
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "removeButton",
+ "type": "function",
+ "description": "Removes the specified button from the spaces toolbar. Throws an exception if the requested spaces toolbar button does not exist or was not created by this extension. If the tab of this button is currently open, it will be closed.",
+ "async": true,
+ "parameters": [
+ {
+ "name": "id",
+ "type": "string",
+ "pattern": "^[a-zA-Z0-9_]+$",
+ "description": "The id of the spaces toolbar button, which is to be removed. May only contain alphanumeric characters and underscores."
+ }
+ ]
+ },
+ {
+ "name": "updateButton",
+ "type": "function",
+ "description": "Updates properties of the specified spaces toolbar button. Throws an exception if the requested spaces toolbar button does not exist or was not created by this extension.",
+ "async": true,
+ "parameters": [
+ {
+ "name": "id",
+ "type": "string",
+ "description": "The id of the spaces toolbar button, which is to be updated. May only contain alphanumeric characters and underscores.",
+ "pattern": "^[a-zA-Z0-9_]+$"
+ },
+ {
+ "name": "properties",
+ "description": "Only specified properties will be updated.",
+ "$ref": "spacesToolbar.ButtonProperties"
+ }
+ ]
+ },
+ {
+ "name": "clickButton",
+ "type": "function",
+ "description": "Trigger a click on the specified spaces toolbar button. Throws an exception if the requested spaces toolbar button does not exist or was not created by this extension.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "id",
+ "type": "string",
+ "description": "The id of the spaces toolbar button. May only contain alphanumeric characters and underscores.",
+ "pattern": "^[a-zA-Z0-9_]+$"
+ },
+ {
+ "name": "windowId",
+ "type": "integer",
+ "minimum": -2,
+ "optional": true,
+ "description": "The id of the normal window, where the spaces toolbar button should be clicked. Defaults to the most recent normal window."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "tab",
+ "$ref": "tabs.Tab",
+ "optional": true,
+ "description": "Details about the opened or activated tab."
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/comm/mail/components/extensions/schemas/tabs.json b/comm/mail/components/extensions/schemas/tabs.json
new file mode 100644
index 0000000000..7d68f01b32
--- /dev/null
+++ b/comm/mail/components/extensions/schemas/tabs.json
@@ -0,0 +1,989 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "OptionalPermissionNoPrompt",
+ "choices": [
+ {
+ "type": "string",
+ "enum": ["activeTab"]
+ }
+ ]
+ },
+ {
+ "$extend": "OptionalPermission",
+ "choices": [
+ {
+ "type": "string",
+ "enum": ["tabs", "tabHide"]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "namespace": "tabs",
+ "description": "The tabs API supports creating, modifying and interacting with tabs in Thunderbird windows.",
+ "types": [
+ {
+ "id": "Tab",
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "minimum": -1,
+ "optional": true,
+ "description": "The ID of the tab. Tab IDs are unique within a session. Under some circumstances a Tab may not be assigned an ID. Tab ID can also be set to :ref:`tabs.TAB_ID_NONE` for apps and devtools windows."
+ },
+ "index": {
+ "type": "integer",
+ "minimum": -1,
+ "description": "The zero-based index of the tab within its window."
+ },
+ "windowId": {
+ "type": "integer",
+ "optional": true,
+ "minimum": 0,
+ "description": "The ID of the window the tab is contained within."
+ },
+ "selected": {
+ "type": "boolean",
+ "description": "Whether the tab is selected.",
+ "deprecated": "Please use :ref:`tabs.Tab.highlighted`.",
+ "unsupported": true
+ },
+ "highlighted": {
+ "type": "boolean",
+ "description": "Whether the tab is highlighted. Works as an alias of active"
+ },
+ "active": {
+ "type": "boolean",
+ "description": "Whether the tab is active in its window. (Does not necessarily mean the window is focused.)"
+ },
+ "url": {
+ "type": "string",
+ "optional": true,
+ "permissions": ["tabs"],
+ "description": "The URL the tab is displaying. This property is only present if the extension's manifest includes the <permission>tabs</permission> permission."
+ },
+ "title": {
+ "type": "string",
+ "optional": true,
+ "permissions": ["tabs"],
+ "description": "The title of the tab. This property is only present if the extension's manifest includes the <permission>tabs</permission> permission."
+ },
+ "favIconUrl": {
+ "type": "string",
+ "optional": true,
+ "permissions": ["tabs"],
+ "description": "The URL of the tab's favicon. This property is only present if the extension's manifest includes the <permission>tabs</permission> permission. It may also be an empty string if the tab is loading."
+ },
+ "status": {
+ "type": "string",
+ "optional": true,
+ "description": "Either <value>loading</value> or <value>complete</value>."
+ },
+ "width": {
+ "type": "integer",
+ "optional": true,
+ "description": "The width of the tab in pixels."
+ },
+ "height": {
+ "type": "integer",
+ "optional": true,
+ "description": "The height of the tab in pixels."
+ },
+ "cookieStoreId": {
+ "type": "string",
+ "optional": true,
+ "description": "The `CookieStore <|link-cookieStore|>`__ id used by the tab. Either a custom id created using the `contextualIdentities API <|link-contextualIdentity|>`__, or a built-in one: <value>firefox-default</value>, <value>firefox-container-1</value>, <value>firefox-container-2</value>, <value>firefox-container-3</value>, <value>firefox-container-4</value>, <value>firefox-container-5</value>. **Note:** The naming pattern was deliberately not changed for Thunderbird, but kept for compatibility reasons."
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "addressBook",
+ "calendar",
+ "calendarEvent",
+ "calendarTask",
+ "chat",
+ "content",
+ "mail",
+ "messageCompose",
+ "messageDisplay",
+ "special",
+ "tasks"
+ ],
+ "optional": true
+ },
+ "mailTab": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the tab is a 3-pane tab."
+ },
+ "spaceId": {
+ "type": "integer",
+ "description": "The id of the space.",
+ "minimum": 1,
+ "optional": true
+ }
+ }
+ },
+ {
+ "id": "TabStatus",
+ "type": "string",
+ "enum": ["loading", "complete"],
+ "description": "Whether the tabs have completed loading."
+ },
+ {
+ "id": "WindowType",
+ "type": "string",
+ "description": "The type of a window. Under some circumstances a Window may not be assigned a type property.",
+ "enum": [
+ "normal",
+ "popup",
+ "panel",
+ "app",
+ "devtools",
+ "messageCompose",
+ "messageDisplay"
+ ]
+ },
+ {
+ "id": "UpdatePropertyName",
+ "type": "string",
+ "enum": ["favIconUrl", "status", "title"],
+ "description": "Event names supported in onUpdated."
+ },
+ {
+ "id": "UpdateFilter",
+ "type": "object",
+ "description": "An object describing filters to apply to tabs.onUpdated events.",
+ "properties": {
+ "urls": {
+ "type": "array",
+ "description": "A list of URLs or URL patterns. Events that cannot match any of the URLs will be filtered out. Filtering with urls requires the <permission>tabs</permission> or <permission>activeTab</permission> permission.",
+ "optional": true,
+ "items": {
+ "type": "string"
+ },
+ "minItems": 1
+ },
+ "properties": {
+ "type": "array",
+ "optional": true,
+ "description": "A list of property names. Events that do not match any of the names will be filtered out.",
+ "items": {
+ "$ref": "UpdatePropertyName"
+ },
+ "minItems": 1
+ },
+ "tabId": {
+ "type": "integer",
+ "optional": true
+ },
+ "windowId": {
+ "type": "integer",
+ "optional": true
+ }
+ }
+ }
+ ],
+ "properties": {
+ "TAB_ID_NONE": {
+ "value": -1,
+ "description": "An ID which represents the absence of a tab."
+ }
+ },
+ "functions": [
+ {
+ "name": "get",
+ "type": "function",
+ "description": "Retrieves details about the specified tab.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "minimum": 0
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "tab",
+ "$ref": "Tab"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getCurrent",
+ "type": "function",
+ "description": "Gets the tab that this script call is being made from. May be undefined if called from a non-tab context (for example: a background page or popup view).",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "tab",
+ "$ref": "Tab",
+ "optional": true
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "connect",
+ "type": "function",
+ "description": "Connects to the content script(s) in the specified tab. The `runtime.onConnect <|link-runtime-on-connect|>`__ event is fired in each content script running in the specified tab for the current extension. For more details, see `Content Script Messaging <|link-content-scripts|>`__.",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "minimum": 0
+ },
+ {
+ "type": "object",
+ "name": "connectInfo",
+ "properties": {
+ "name": {
+ "type": "string",
+ "optional": true,
+ "description": "Will be passed into onConnect for content scripts that are listening for the connection event."
+ },
+ "frameId": {
+ "type": "integer",
+ "optional": true,
+ "minimum": 0,
+ "description": "Open a port to a specific frame identified by ``frameId`` instead of all frames in the tab."
+ }
+ },
+ "optional": true
+ }
+ ],
+ "returns": {
+ "$ref": "runtime.Port",
+ "description": "A port that can be used to communicate with the content scripts running in the specified tab."
+ }
+ },
+ {
+ "name": "sendMessage",
+ "type": "function",
+ "description": "Sends a single message to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The `runtime.onMessage <|link-runtime-on-message|>`__ event is fired in each content script running in the specified tab for the current extension.",
+ "async": "responseCallback",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "minimum": 0
+ },
+ {
+ "type": "any",
+ "name": "message"
+ },
+ {
+ "type": "object",
+ "name": "options",
+ "properties": {
+ "frameId": {
+ "type": "integer",
+ "optional": true,
+ "minimum": 0,
+ "description": "Send a message to a specific frame identified by ``frameId`` instead of all frames in the tab."
+ }
+ },
+ "optional": true
+ },
+ {
+ "type": "function",
+ "name": "responseCallback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "response",
+ "type": "any",
+ "description": "The JSON response object sent by the handler of the message. If an error occurs while connecting to the specified tab, the callback will be called with no arguments and `runtime.lastError <|link-runtime-last-error|>`__ will be set to the error message."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "create",
+ "type": "function",
+ "description": "Creates a new content tab. Use the :ref:`messageDisplay_api` to open messages. Only supported in <value>normal</value> windows. Same-site links in the loaded page are opened within Thunderbird, all other links are opened in the user's default browser. To override this behavior, add-ons have to register a `content script <https://bugzilla.mozilla.org/show_bug.cgi?id=1618828#c3>`__ , capture click events and handle them manually.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "createProperties",
+ "description": "Properties for the new tab. Defaults to an empty tab, if no ``url`` is provided.",
+ "properties": {
+ "windowId": {
+ "type": "integer",
+ "minimum": -2,
+ "optional": true,
+ "description": "The window to create the new tab in. Defaults to the current window."
+ },
+ "index": {
+ "type": "integer",
+ "minimum": 0,
+ "optional": true,
+ "description": "The position the tab should take in the window. The provided value will be clamped to between zero and the number of tabs in the window."
+ },
+ "url": {
+ "type": "string",
+ "optional": true,
+ "description": "The URL to navigate the tab to initially. Fully-qualified URLs must include a scheme (i.e. <value>http://www.google.com</value>, not <value>www.google.com</value>). Relative URLs will be relative to the current page within the extension."
+ },
+ "active": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the tab should become the active tab in the window. Does not affect whether the window is focused (see :ref:`windows.update`). Defaults to <value>true</value>."
+ },
+ "cookieStoreId": {
+ "type": "string",
+ "optional": true,
+ "description": "The `CookieStore <|link-cookieStore|>`__ id the new tab should use. Either a custom id created using the `contextualIdentities API <|link-contextualIdentity|>`__, or a built-in one: <value>firefox-default</value>, <value>firefox-container-1</value>, <value>firefox-container-2</value>, <value>firefox-container-3</value>, <value>firefox-container-4</value>, <value>firefox-container-5</value>. **Note:** The naming pattern was deliberately not changed for Thunderbird, but kept for compatibility reasons."
+ },
+ "selected": {
+ "deprecated": "Please use ``createProperties.active``.",
+ "unsupported": true,
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the tab should become the selected tab in the window. Defaults to <value>true</value>"
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "tab",
+ "$ref": "Tab",
+ "optional": true,
+ "description": "Details about the created tab. Will contain the ID of the new tab."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "duplicate",
+ "type": "function",
+ "description": "Duplicates a tab.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "minimum": 0,
+ "description": "The ID of the tab which is to be duplicated."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "tab",
+ "optional": true,
+ "description": "Details about the duplicated tab. The :ref:`tabs.Tab` object doesn't contain ``url``, ``title`` and ``favIconUrl`` if the <permission>tabs</permission> permission has not been requested.",
+ "$ref": "Tab"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "query",
+ "type": "function",
+ "description": "Gets all tabs that have the specified properties, or all tabs if no properties are specified.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "queryInfo",
+ "optional": true,
+ "default": {},
+ "properties": {
+ "mailTab": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the tab is a Thunderbird 3-pane tab."
+ },
+ "spaceId": {
+ "type": "integer",
+ "description": "The id of the space the tabs should belong to.",
+ "minimum": 1,
+ "optional": true
+ },
+ "type": {
+ "type": "string",
+ "optional": true,
+ "description": "Match tabs against the given Tab.type (see :ref:`tabs.Tab`). Ignored if ``queryInfo.mailTab`` is specified."
+ },
+ "active": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the tabs are active in their windows."
+ },
+ "highlighted": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the tabs are highlighted. Works as an alias of active."
+ },
+ "currentWindow": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the tabs are in the current window."
+ },
+ "lastFocusedWindow": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether the tabs are in the last focused window."
+ },
+ "status": {
+ "$ref": "TabStatus",
+ "optional": true,
+ "description": "Whether the tabs have completed loading."
+ },
+ "title": {
+ "type": "string",
+ "optional": true,
+ "description": "Match page titles against a pattern."
+ },
+ "url": {
+ "choices": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ ],
+ "optional": true,
+ "description": "Match tabs against one or more `URL Patterns <|link-match-patterns|>`__. Note that fragment identifiers are not matched."
+ },
+ "windowId": {
+ "type": "integer",
+ "optional": true,
+ "minimum": -2,
+ "description": "The ID of the parent window, or :ref:`windows.WINDOW_ID_CURRENT` for the current window."
+ },
+ "windowType": {
+ "$ref": "WindowType",
+ "optional": true,
+ "description": "The type of window the tabs are in."
+ },
+ "index": {
+ "type": "integer",
+ "optional": true,
+ "minimum": 0,
+ "description": "The position of the tabs within their windows."
+ },
+ "cookieStoreId": {
+ "choices": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "string"
+ }
+ ],
+ "optional": true,
+ "description": "The `CookieStore <|link-cookieStore|>`__ id(s) used by the tabs. Either custom ids created using the `contextualIdentities API <|link-contextualIdentity|>`__, or built-in ones: <value>firefox-default</value>, <value>firefox-container-1</value>, <value>firefox-container-2</value>, <value>firefox-container-3</value>, <value>firefox-container-4</value>, <value>firefox-container-5</value>. **Note:** The naming pattern was deliberately not changed for Thunderbird, but kept for compatibility reasons."
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "result",
+ "type": "array",
+ "items": {
+ "$ref": "Tab"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "update",
+ "type": "function",
+ "description": "Modifies the properties of a tab. Properties that are not specified in ``updateProperties`` are not modified.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "minimum": 0,
+ "optional": true,
+ "description": "Defaults to the selected tab of the current window."
+ },
+ {
+ "type": "object",
+ "name": "updateProperties",
+ "description": "Properties which should to be updated.",
+ "properties": {
+ "url": {
+ "type": "string",
+ "optional": true,
+ "description": "A URL of a page to load. If the URL points to a content page (a web page, an extension page or a registered WebExtension protocol handler page), the tab will navigate to the requested page. All other URLs will be opened externally without changing the tab. Note: This function will throw an error, if a content page is loaded into a non-content tab (its type must be either <value>content</value> or <value>mail</value>)."
+ },
+ "active": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Set this to <value>true</value>, if the tab should become active. Does not affect whether the window is focused (see :ref:`windows.update`). Setting this to <value>false</value> has no effect."
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "tab",
+ "$ref": "Tab",
+ "optional": true,
+ "description": "Details about the updated tab. The :ref:`tabs.Tab` object doesn't contain ``url``, ``title`` and ``favIconUrl`` if the <permission>tabs</permission> permission has not been requested."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "move",
+ "type": "function",
+ "description": "Moves one or more tabs to a new position within its current window, or to a different window. Note that tabs can only be moved to and from windows of type <value>normal</value>.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "tabIds",
+ "description": "The tab or list of tabs to move.",
+ "choices": [
+ {
+ "type": "integer",
+ "minimum": 0
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "integer",
+ "minimum": 0
+ }
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "name": "moveProperties",
+ "properties": {
+ "windowId": {
+ "type": "integer",
+ "minimum": -2,
+ "optional": true,
+ "description": "Defaults to the window the tab is currently in."
+ },
+ "index": {
+ "type": "integer",
+ "minimum": -1,
+ "description": "The position to move the tab to. <value>-1</value> will place the tab at the end of the window."
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "tabs",
+ "description": "Details about the moved tabs.",
+ "type": "array",
+ "items": {
+ "$ref": "Tab"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "reload",
+ "type": "function",
+ "description": "Reload a tab. Only applicable for tabs which display a content page.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "minimum": 0,
+ "optional": true,
+ "description": "The ID of the tab to reload; defaults to the selected tab of the current window."
+ },
+ {
+ "type": "object",
+ "name": "reloadProperties",
+ "optional": true,
+ "properties": {
+ "bypassCache": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Whether using any local cache. Default is false."
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "remove",
+ "type": "function",
+ "description": "Closes one or more tabs.",
+ "async": "callback",
+ "parameters": [
+ {
+ "name": "tabIds",
+ "description": "The tab or list of tabs to close.",
+ "choices": [
+ {
+ "type": "integer",
+ "minimum": 0
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "integer",
+ "minimum": 0
+ }
+ }
+ ]
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "executeScript",
+ "type": "function",
+ "description": "Injects JavaScript code into a page. For details, see the `programmatic injection <|link-content-scripts|>`__ section of the content scripts doc.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "minimum": 0,
+ "optional": true,
+ "description": "The ID of the tab in which to run the script; defaults to the active tab of the current window."
+ },
+ {
+ "$ref": "extensionTypes.InjectDetails",
+ "name": "details",
+ "description": "Details of the script to run."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "description": "Called after all the JavaScript has been executed.",
+ "parameters": [
+ {
+ "name": "result",
+ "optional": true,
+ "type": "array",
+ "items": {
+ "type": "any"
+ },
+ "description": "The result of the script in every injected frame."
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "insertCSS",
+ "type": "function",
+ "description": "Injects CSS into a page. For details, see the `programmatic injection <|link-content-scripts|>`__ section of the content scripts doc.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "minimum": 0,
+ "optional": true,
+ "description": "The ID of the tab in which to insert the CSS; defaults to the active tab of the current window."
+ },
+ {
+ "$ref": "extensionTypes.InjectDetails",
+ "name": "details",
+ "description": "Details of the CSS text to insert."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "description": "Called when all the CSS has been inserted.",
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "removeCSS",
+ "type": "function",
+ "description": "Removes injected CSS from a page. For details, see the `programmatic injection <|link-content-scripts|>`__ section of the content scripts doc.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "minimum": 0,
+ "optional": true,
+ "description": "The ID of the tab from which to remove the injected CSS; defaults to the active tab of the current window."
+ },
+ {
+ "$ref": "extensionTypes.InjectDetails",
+ "name": "details",
+ "description": "Details of the CSS text to remove."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "description": "Called when all the CSS has been removed.",
+ "parameters": []
+ }
+ ]
+ }
+ ],
+ "events": [
+ {
+ "name": "onCreated",
+ "type": "function",
+ "description": "Fired when a tab is created. Note that the tab's URL may not be set at the time this event fired, but you can listen to onUpdated events to be notified when a URL is set.",
+ "parameters": [
+ {
+ "$ref": "Tab",
+ "name": "tab",
+ "description": "Details of the tab that was created."
+ }
+ ]
+ },
+ {
+ "name": "onUpdated",
+ "type": "function",
+ "description": "Fired when a tab is updated.",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "minimum": 0
+ },
+ {
+ "type": "object",
+ "name": "changeInfo",
+ "description": "Lists the changes to the state of the tab that was updated.",
+ "properties": {
+ "status": {
+ "type": "string",
+ "optional": true,
+ "description": "The status of the tab. Can be either <value>loading</value> or <value>complete</value>."
+ },
+ "url": {
+ "type": "string",
+ "optional": true,
+ "description": "The tab's URL if it has changed."
+ },
+ "favIconUrl": {
+ "type": "string",
+ "optional": true,
+ "description": "The tab's new favicon URL."
+ }
+ }
+ },
+ {
+ "$ref": "Tab",
+ "name": "tab",
+ "description": "Gives the state of the tab that was updated."
+ }
+ ],
+ "extraParameters": [
+ {
+ "$ref": "UpdateFilter",
+ "name": "filter",
+ "optional": true,
+ "description": "A set of filters that restricts the events that will be sent to this listener."
+ }
+ ]
+ },
+ {
+ "name": "onMoved",
+ "type": "function",
+ "description": "Fired when a tab is moved within a window. Only one move event is fired, representing the tab the user directly moved. Move events are not fired for the other tabs that must move in response. This event is not fired when a tab is moved between windows. For that, see :ref:`tabs.onDetached`.",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "minimum": 0
+ },
+ {
+ "type": "object",
+ "name": "moveInfo",
+ "properties": {
+ "windowId": {
+ "type": "integer",
+ "minimum": 0
+ },
+ "fromIndex": {
+ "type": "integer",
+ "minimum": 0
+ },
+ "toIndex": {
+ "type": "integer",
+ "minimum": 0
+ }
+ }
+ }
+ ]
+ },
+ {
+ "name": "onActivated",
+ "type": "function",
+ "description": "Fires when the active tab in a window changes. Note that the tab's URL may not be set at the time this event fired, but you can listen to onUpdated events to be notified when a URL is set.",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "activeInfo",
+ "properties": {
+ "tabId": {
+ "type": "integer",
+ "minimum": 0,
+ "description": "The ID of the tab that has become active."
+ },
+ "previousTabId": {
+ "type": "integer",
+ "minimum": 0,
+ "optional": true,
+ "description": "The ID of the tab that was previously active, if that tab is still open."
+ },
+ "windowId": {
+ "type": "integer",
+ "minimum": 0,
+ "description": "The ID of the window the active tab changed inside of."
+ }
+ }
+ }
+ ]
+ },
+ {
+ "name": "onDetached",
+ "type": "function",
+ "description": "Fired when a tab is detached from a window, for example because it is being moved between windows.",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "minimum": 0
+ },
+ {
+ "type": "object",
+ "name": "detachInfo",
+ "properties": {
+ "oldWindowId": {
+ "type": "integer",
+ "minimum": 0
+ },
+ "oldPosition": {
+ "type": "integer",
+ "minimum": 0
+ }
+ }
+ }
+ ]
+ },
+ {
+ "name": "onAttached",
+ "type": "function",
+ "description": "Fired when a tab is attached to a window, for example because it was moved between windows.",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "minimum": 0
+ },
+ {
+ "type": "object",
+ "name": "attachInfo",
+ "properties": {
+ "newWindowId": {
+ "type": "integer",
+ "minimum": 0
+ },
+ "newPosition": {
+ "type": "integer",
+ "minimum": 0
+ }
+ }
+ }
+ ]
+ },
+ {
+ "name": "onRemoved",
+ "type": "function",
+ "description": "Fired when a tab is closed.",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "tabId",
+ "minimum": 0
+ },
+ {
+ "type": "object",
+ "name": "removeInfo",
+ "properties": {
+ "windowId": {
+ "type": "integer",
+ "minimum": 0,
+ "description": "The window whose tab is closed."
+ },
+ "isWindowClosing": {
+ "type": "boolean",
+ "description": "Is <value>true</value> when the tab is being closed because its window is being closed."
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/comm/mail/components/extensions/schemas/theme.json b/comm/mail/components/extensions/schemas/theme.json
new file mode 100644
index 0000000000..cba8abd780
--- /dev/null
+++ b/comm/mail/components/extensions/schemas/theme.json
@@ -0,0 +1,542 @@
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+[
+ {
+ "namespace": "manifest",
+ "types": [
+ {
+ "$extend": "PermissionNoPrompt",
+ "choices": [
+ {
+ "type": "string",
+ "enum": ["theme"]
+ }
+ ]
+ },
+ {
+ "id": "ThemeColor",
+ "description": "Defines a color value.",
+ "choices": [
+ {
+ "type": "string",
+ "description": "A string containing a valid `CSS color string <|link-css-color-string|>`__, including hexadecimal or functional representations. For example the color *crimson* can be specified as: <li><value>crimson</value> <li><value>#dc143c</value> <li><value>rgb(220, 20, 60)</value> (or <value>rgba(220, 20, 60, 0.5)</value> to set 50% opacity) <li><value>hsl(348, 83%, 47%)</value> (or <value>hsla(348, 83%, 47%, 0.5)</value> to set 50% opacity)"
+ },
+ {
+ "type": "array",
+ "description": "An RGB array of 3 integers. For example <value>[220, 20, 60]</value> for the color *crimson*.",
+ "minItems": 3,
+ "maxItems": 3,
+ "items": {
+ "type": "integer",
+ "minimum": 0,
+ "maximum": 255
+ }
+ },
+ {
+ "type": "array",
+ "description": "An RGBA array of 3 integers and a fractional (a float between 0 and 1). For example <value>[220, 20, 60, 0.5]<value> for the color *crimson* with 50% opacity.",
+ "minItems": 4,
+ "maxItems": 4,
+ "items": {
+ "type": "number"
+ }
+ }
+ ]
+ },
+ {
+ "id": "ThemeExperiment",
+ "description": "Defines additional color, image and property keys to be used in :ref:`theme.ThemeType`, extending the theme-able areas of Thunderbird.",
+ "type": "object",
+ "properties": {
+ "stylesheet": {
+ "optional": true,
+ "description": "URL to a stylesheet introducing additional CSS variables, extending the theme-able areas of Thunderbird. The `theme_experiment add-on in our example repository <https://github.com/thunderbird/sample-extensions/tree/master/theme_experiment>`__ is using the stylesheet shown below, to add the <value>--chat-button-color</value> CSS color variable: <literalinclude>includes/theme/theme_experiment_style.css<lang>CSS</lang></literalinclude>The following <em>manifest.json</em> file maps the </value>--chat-button-color</value> CSS color variable to the theme color key <value>exp_chat_button</value> and uses it to set a color for the chat button: <literalinclude>includes/theme/theme_experiment_manifest.json<lang>JSON</lang></literalinclude>",
+ "$ref": "ExtensionURL"
+ },
+ "images": {
+ "type": "object",
+ "optional": true,
+ "description": "A <em>dictionary object</em> with one or more <em>key-value</em> pairs to map new theme image keys to internal Thunderbird CSS image variables. The new image key is usable as an image reference in :ref:`theme.ThemeType`. Example: <literalinclude>includes/theme/theme_experiment_image.json<lang>JSON</lang></literalinclude>",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "colors": {
+ "type": "object",
+ "optional": true,
+ "description": "A <em>dictionary object</em> with one or more <em>key-value</em> pairs to map new theme color keys to internal Thunderbird CSS color variables. The example shown below maps the theme color key <value>popup_affordance</value> to the CSS color variable </value>--arrowpanel-dimmed</value>. The new color key is usable as a color reference in :ref:`theme.ThemeType`. <literalinclude>includes/theme/theme_experiment_color.json<lang>JSON</lang></literalinclude>",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "properties": {
+ "type": "object",
+ "optional": true,
+ "description": "A <em>dictionary object</em> with one or more <em>key-value</em> pairs to map new theme property keys to internal Thunderbird CSS property variables. The new property key is usable as a property reference in :ref:`theme.ThemeType`. Example: <literalinclude>includes/theme/theme_experiment_property.json<lang>JSON</lang></literalinclude>",
+ "additionalProperties": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ {
+ "id": "ThemeType",
+ "description": "Contains the color, image and property settings of a theme.",
+ "type": "object",
+ "properties": {
+ "images": {
+ "description": "A <em>dictionary object</em> with one or more <em>key-value</em> pairs to map images to theme image keys. The following built-in theme image keys are supported:",
+ "type": "object",
+ "optional": true,
+ "properties": {
+ "additional_backgrounds": {
+ "type": "array",
+ "items": {
+ "$ref": "ImageDataOrExtensionURL"
+ },
+ "maxItems": 15,
+ "optional": true,
+ "description": "Additional images added to the header area and displayed behind the ``theme_frame`` image."
+ },
+ "headerURL": {
+ "$ref": "ImageDataOrExtensionURL",
+ "optional": true,
+ "deprecated": "Unsupported images property, use ``theme.images.theme_frame``, this alias is ignored in Thunderbird >= 70."
+ },
+ "theme_frame": {
+ "$ref": "ImageDataOrExtensionURL",
+ "optional": true,
+ "description": "Foreground image on the header area."
+ }
+ },
+ "additionalProperties": {
+ "$ref": "ImageDataOrExtensionURL"
+ }
+ },
+ "colors": {
+ "description": "A <em>dictionary object</em> with one or more <em>key-value</em> pairs to map color values to theme color keys. The following built-in theme color keys are supported:",
+ "type": "object",
+ "optional": true,
+ "properties": {
+ "tab_selected": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "Background color of the selected tab. Defaults to the color specified by ``toolbar``."
+ },
+ "accentcolor": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "deprecated": "Unsupported colors property, use ``theme.colors.frame``, this alias is ignored in Thunderbird >= 70."
+ },
+ "frame": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "The background color of the header area."
+ },
+ "frame_inactive": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "The background color of the header area when the window is inactive."
+ },
+ "textcolor": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "deprecated": "Unsupported color property, use ``theme.colors.tab_background_text``, this alias is ignored in Thunderbird >= 70."
+ },
+ "tab_background_text": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "The text color of the unselected tabs."
+ },
+ "tab_background_separator": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "The color of the vertical separator of the background tabs."
+ },
+ "tab_loading": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "The color of the tab loading indicator."
+ },
+ "tab_text": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "The text color for the selected tab. Defaults to the color specified by ``toolbar_text``."
+ },
+ "tab_line": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "The color of the selected tab line."
+ },
+ "toolbar": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "The background color of the toolbars. Also used as default value for ``tab_selected``."
+ },
+ "toolbar_text": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "The text color in the main Thunderbird toolbar. Also used as default value for ``icons`` and ``tab_text``."
+ },
+ "bookmark_text": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "Not used in Thunderbird."
+ },
+ "toolbar_field": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "The background color for fields in the toolbar, such as the search field."
+ },
+ "toolbar_field_text": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "The text color for fields in the toolbar."
+ },
+ "toolbar_field_border": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "The border color for fields in the toolbar."
+ },
+ "toolbar_field_separator": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "Not used in Thunderbird.",
+ "deprecated": "This color property is ignored in >= 89."
+ },
+ "toolbar_top_separator": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "The color of the line separating the top of the toolbar from the region above."
+ },
+ "toolbar_bottom_separator": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "The color of the line separating the bottom of the toolbar from the region below."
+ },
+ "toolbar_vertical_separator": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "The color of the vertical separators on the toolbars."
+ },
+ "icons": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "The color of the toolbar icons. Defaults to the color specified by ``toolbar_text``."
+ },
+ "icons_attention": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "The color of the toolbar icons in attention state such as the chat icon with new messages."
+ },
+ "button_background_hover": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "The color of the background of the toolbar buttons on hover."
+ },
+ "button_background_active": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "The color of the background of the pressed toolbar buttons."
+ },
+ "popup": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "The background color of popups such as the AppMenu."
+ },
+ "popup_text": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "The text color of popups."
+ },
+ "popup_border": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "The border color of popups."
+ },
+ "toolbar_field_focus": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "The focused background color for fields in the toolbar."
+ },
+ "toolbar_field_text_focus": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "The text color in the focused fields in the toolbar."
+ },
+ "toolbar_field_border_focus": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "The focused border color for fields in the toolbar."
+ },
+ "popup_highlight": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "The background color of items highlighted using the keyboard inside popups."
+ },
+ "popup_highlight_text": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "The text color of items highlighted using the keyboard inside popups."
+ },
+ "ntp_background": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "Not used in Thunderbird."
+ },
+ "ntp_text": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "Not used in Thunderbird."
+ },
+ "sidebar": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "The background color of the trees."
+ },
+ "sidebar_border": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "The border color of the trees."
+ },
+ "sidebar_text": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "The text color of the trees. Needed to enable the tree theming."
+ },
+ "sidebar_highlight": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "The background color of highlighted rows in trees."
+ },
+ "sidebar_highlight_text": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "The text color of highlighted rows in trees."
+ },
+ "sidebar_highlight_border": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "The border color of highlighted rows in trees."
+ },
+ "toolbar_field_highlight": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "The background color used to indicate the current selection of text in the search field."
+ },
+ "toolbar_field_highlight_text": {
+ "$ref": "ThemeColor",
+ "optional": true,
+ "description": "The color used to draw text that's currently selected in the search field."
+ }
+ },
+ "additionalProperties": {
+ "$ref": "ThemeColor"
+ }
+ },
+ "properties": {
+ "description": "A <em>dictionary object</em> with one or more <em>key-value</em> pairs to map property values to theme property keys. The following built-in theme property keys are supported:",
+ "type": "object",
+ "optional": true,
+ "properties": {
+ "additional_backgrounds_alignment": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "bottom",
+ "center",
+ "left",
+ "right",
+ "top",
+ "center bottom",
+ "center center",
+ "center top",
+ "left bottom",
+ "left center",
+ "left top",
+ "right bottom",
+ "right center",
+ "right top"
+ ]
+ },
+ "maxItems": 15,
+ "optional": true
+ },
+ "additional_backgrounds_tiling": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": ["no-repeat", "repeat", "repeat-x", "repeat-y"]
+ },
+ "maxItems": 15,
+ "optional": true
+ },
+ "color_scheme": {
+ "description": "If set, overrides the general theme (context menus, toolbars, content area).",
+ "optional": true,
+ "type": "string",
+ "enum": ["light", "dark", "auto"]
+ },
+ "content_color_scheme": {
+ "description": "If set, overrides the color scheme for the content area.",
+ "optional": true,
+ "type": "string",
+ "enum": ["light", "dark", "auto"]
+ }
+ },
+ "additionalProperties": {
+ "type": "string"
+ }
+ }
+ },
+ "additionalProperties": {
+ "$ref": "UnrecognizedProperty"
+ }
+ },
+ {
+ "id": "ThemeManifest",
+ "type": "object",
+ "description": "Contents of manifest.json for a static theme",
+ "$import": "manifest.ManifestBase",
+ "properties": {
+ "theme": {
+ "$ref": "ThemeType"
+ },
+ "dark_theme": {
+ "$ref": "ThemeType",
+ "optional": true,
+ "description": "Fallback properties for the dark system theme."
+ },
+ "default_locale": {
+ "type": "string",
+ "optional": true
+ },
+ "theme_experiment": {
+ "$ref": "ThemeExperiment",
+ "optional": true,
+ "description": "CSS file with additional styles."
+ },
+ "icons": {
+ "type": "object",
+ "optional": true,
+ "patternProperties": {
+ "^[1-9]\\d*$": {
+ "type": "string"
+ }
+ },
+ "description": "Icons shown in the Add-ons Manager."
+ }
+ }
+ },
+ {
+ "$extend": "WebExtensionManifest",
+ "properties": {
+ "theme_experiment": {
+ "$ref": "ThemeExperiment",
+ "optional": true,
+ "description": "A theme experiment allows modifying the user interface of Thunderbird beyond what is currently possible using the built-in color, image and property keys of :ref:`theme.ThemeType`. These experiments are a precursor to proposing new theme features for inclusion in Thunderbird. Experimentation is done by mapping internal CSS color, image and property variables to new theme keys and using them in :ref:`theme.ThemeType` and by loading additional style sheets to add new CSS variables, extending the theme-able areas of Thunderbird. Can be used in static and dynamic themes."
+ }
+ }
+ }
+ ]
+ },
+ {
+ "namespace": "theme",
+ "description": "The theme API allows for customization of Thunderbird's visual elements.",
+ "types": [
+ {
+ "id": "ThemeUpdateInfo",
+ "type": "object",
+ "description": "Info provided in the onUpdated listener.",
+ "properties": {
+ "theme": {
+ "$ref": "ThemeType",
+ "description": "The new theme after update"
+ },
+ "windowId": {
+ "type": "integer",
+ "description": "The id of the window the theme has been applied to",
+ "optional": true
+ }
+ }
+ }
+ ],
+ "events": [
+ {
+ "name": "onUpdated",
+ "type": "function",
+ "description": "Fired when a new theme has been applied",
+ "parameters": [
+ {
+ "$ref": "ThemeUpdateInfo",
+ "name": "updateInfo",
+ "description": "Details of the theme update"
+ }
+ ]
+ }
+ ],
+ "functions": [
+ {
+ "name": "getCurrent",
+ "type": "function",
+ "async": "callback",
+ "description": "Returns the current theme for the specified window or the last focused window.",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "windowId",
+ "optional": true,
+ "description": "The window for which we want the theme."
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "$ref": "ThemeType"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "update",
+ "type": "function",
+ "async": true,
+ "description": "Make complete updates to the theme. Resolves when the update has completed.",
+ "permissions": ["theme"],
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "windowId",
+ "optional": true,
+ "description": "The id of the window to update. No id updates all windows."
+ },
+ {
+ "name": "details",
+ "$ref": "manifest.ThemeType",
+ "description": "The properties of the theme to update."
+ }
+ ]
+ },
+ {
+ "name": "reset",
+ "type": "function",
+ "async": true,
+ "description": "Removes the updates made to the theme.",
+ "permissions": ["theme"],
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "windowId",
+ "optional": true,
+ "description": "The id of the window to reset. No id resets all windows."
+ }
+ ]
+ }
+ ]
+ }
+]
diff --git a/comm/mail/components/extensions/schemas/windows.json b/comm/mail/components/extensions/schemas/windows.json
new file mode 100644
index 0000000000..129364e155
--- /dev/null
+++ b/comm/mail/components/extensions/schemas/windows.json
@@ -0,0 +1,511 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+[
+ {
+ "namespace": "windows",
+ "description": "The windows API supports creating, modifying and interacting with Thunderbird windows.",
+ "types": [
+ {
+ "id": "WindowType",
+ "type": "string",
+ "description": "The type of a window. Under some circumstances a window may not be assigned a type property.",
+ "enum": ["normal", "popup", "messageCompose", "messageDisplay"]
+ },
+ {
+ "id": "WindowState",
+ "type": "string",
+ "description": "The state of this window.",
+ "enum": ["normal", "minimized", "maximized", "fullscreen", "docked"]
+ },
+ {
+ "id": "Window",
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "optional": true,
+ "minimum": 0,
+ "description": "The ID of the window. Window IDs are unique within a session."
+ },
+ "focused": {
+ "type": "boolean",
+ "description": "Whether the window is currently the focused window."
+ },
+ "top": {
+ "type": "integer",
+ "optional": true,
+ "description": "The offset of the window from the top edge of the screen in pixels."
+ },
+ "left": {
+ "type": "integer",
+ "optional": true,
+ "description": "The offset of the window from the left edge of the screen in pixels."
+ },
+ "width": {
+ "type": "integer",
+ "optional": true,
+ "description": "The width of the window, including the frame, in pixels."
+ },
+ "height": {
+ "type": "integer",
+ "optional": true,
+ "description": "The height of the window, including the frame, in pixels."
+ },
+ "tabs": {
+ "type": "array",
+ "items": {
+ "$ref": "tabs.Tab"
+ },
+ "optional": true,
+ "description": "Array of :ref:`tabs.Tab` objects representing the current tabs in the window. Only included if requested by :ref:`windows.get`, :ref:`windows.getCurrent`, :ref:`windows.getAll` or :ref:`windows.getLastFocused`, and the optional :ref:`windows.GetInfo` parameter has its ``populate`` member set to <value>true</value>."
+ },
+ "incognito": {
+ "type": "boolean",
+ "description": "Whether the window is incognito. Since Thunderbird does not support the incognito mode, this is always <value>false</value>."
+ },
+ "type": {
+ "$ref": "WindowType",
+ "optional": true,
+ "description": "The type of window this is."
+ },
+ "state": {
+ "$ref": "WindowState",
+ "optional": true,
+ "description": "The state of this window."
+ },
+ "alwaysOnTop": {
+ "type": "boolean",
+ "description": "Whether the window is set to be always on top."
+ },
+ "title": {
+ "type": "string",
+ "optional": true,
+ "description": "The title of the window. Read-only."
+ }
+ }
+ },
+ {
+ "id": "CreateType",
+ "type": "string",
+ "description": "Specifies what type of window to create. Thunderbird does not support <value>panel</value> and <value>detached_panel</value>, they are interpreted as <value>popup</value>.",
+ "enum": ["normal", "popup", "panel", "detached_panel"]
+ },
+ {
+ "id": "GetInfo",
+ "type": "object",
+ "description": "Specifies additional requirements for the returned windows.",
+ "properties": {
+ "populate": {
+ "type": "boolean",
+ "optional": true,
+ "description": "If true, the :ref:`windows.Window` returned will have a ``tabs`` property that contains an array of :ref:`tabs.Tab` objects representing the tabs inside the window. The :ref:`tabs.Tab` objects only contain the ``url``, ``title`` and ``favIconUrl`` properties if the extension's manifest file includes the <permission>tabs</permission> permission."
+ },
+ "windowTypes": {
+ "type": "array",
+ "items": {
+ "$ref": "WindowType"
+ },
+ "optional": true,
+ "description": "If set, the :ref:`windows.Window` returned will be filtered based on its type. Supported by :ref:`windows.getAll` only, ignored in all other functions."
+ }
+ }
+ }
+ ],
+ "properties": {
+ "WINDOW_ID_NONE": {
+ "value": -1,
+ "description": "The windowId value that represents the absence of a window."
+ },
+ "WINDOW_ID_CURRENT": {
+ "value": -2,
+ "description": "The windowId value that represents the current window."
+ }
+ },
+ "functions": [
+ {
+ "name": "get",
+ "type": "function",
+ "description": "Gets details about a window.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "windowId",
+ "minimum": -2
+ },
+ {
+ "$ref": "GetInfo",
+ "name": "getInfo",
+ "optional": true
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "window",
+ "$ref": "Window"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getCurrent",
+ "type": "function",
+ "description": "Gets the active or topmost window.",
+ "async": "callback",
+ "parameters": [
+ {
+ "$ref": "GetInfo",
+ "name": "getInfo",
+ "optional": true
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "window",
+ "$ref": "Window"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getLastFocused",
+ "type": "function",
+ "description": "Gets the window that was most recently focused &mdash; typically the window 'on top'.",
+ "async": "callback",
+ "parameters": [
+ {
+ "$ref": "GetInfo",
+ "name": "getInfo",
+ "optional": true
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "window",
+ "$ref": "Window"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "getAll",
+ "type": "function",
+ "description": "Gets all windows.",
+ "async": "callback",
+ "parameters": [
+ {
+ "$ref": "GetInfo",
+ "name": "getInfo",
+ "optional": true
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "parameters": [
+ {
+ "name": "windows",
+ "type": "array",
+ "items": {
+ "$ref": "Window"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "create",
+ "type": "function",
+ "description": "Creates (opens) a new window with any optional sizing, position or default URL provided. When loading a page into a popup window, same-site links are opened within the same window, all other links are opened in the user's default browser. To override this behavior, add-ons have to register a `content script <https://bugzilla.mozilla.org/show_bug.cgi?id=1618828#c3>`__ , capture click events and handle them manually. Same-site links with targets other than <value>_self</value> are opened in a new tab in the most recent ``normal`` Thunderbird window.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "object",
+ "name": "createData",
+ "optional": true,
+ "default": {},
+ "properties": {
+ "url": {
+ "description": "A URL or array of URLs to open as tabs in the window. Fully-qualified URLs must include a scheme (i.e. <value>http://www.google.com</value>, not <value>www.google.com</value>). Relative URLs will be relative to the current page within the extension. Defaults to the New Tab Page.",
+ "optional": true,
+ "choices": [
+ {
+ "type": "string",
+ "format": "relativeUrl"
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "format": "relativeUrl"
+ }
+ }
+ ]
+ },
+ "tabId": {
+ "type": "integer",
+ "minimum": 0,
+ "optional": true,
+ "description": "The id of the tab for which you want to adopt to the new window."
+ },
+ "left": {
+ "type": "integer",
+ "optional": true,
+ "description": "The number of pixels to position the new window from the left edge of the screen. If not specified, the new window is offset naturally from the last focused window."
+ },
+ "top": {
+ "type": "integer",
+ "optional": true,
+ "description": "The number of pixels to position the new window from the top edge of the screen. If not specified, the new window is offset naturally from the last focused window."
+ },
+ "width": {
+ "type": "integer",
+ "minimum": 0,
+ "optional": true,
+ "description": "The width in pixels of the new window, including the frame. If not specified defaults to a natural width."
+ },
+ "height": {
+ "type": "integer",
+ "minimum": 0,
+ "optional": true,
+ "description": "The height in pixels of the new window, including the frame. If not specified defaults to a natural height."
+ },
+ "focused": {
+ "unsupported": true,
+ "type": "boolean",
+ "optional": true,
+ "description": "If true, opens an active window. If false, opens an inactive window."
+ },
+ "incognito": {
+ "unsupported": true,
+ "type": "boolean",
+ "optional": true
+ },
+ "type": {
+ "$ref": "CreateType",
+ "optional": true,
+ "description": "Specifies what type of window to create. Thunderbird does not support <value>panel</value> and <value>detached_panel</value>, they are interpreted as <value>popup</value>."
+ },
+ "state": {
+ "$ref": "WindowState",
+ "optional": true,
+ "description": "The initial state of the window. The ``minimized``, ``maximized`` and ``fullscreen`` states cannot be combined with ``left``, ``top``, ``width`` or ``height``."
+ },
+ "allowScriptsToClose": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Allow scripts running inside the window to close the window by calling <code>window.close()</code>."
+ },
+ "cookieStoreId": {
+ "type": "string",
+ "optional": true,
+ "description": "The CookieStoreId to use for all tabs that were created when the window is opened."
+ },
+ "titlePreface": {
+ "type": "string",
+ "optional": true,
+ "description": "A string to add to the beginning of the window title."
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "window",
+ "$ref": "Window",
+ "description": "Contains details about the created window.",
+ "optional": true
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "update",
+ "type": "function",
+ "description": "Updates the properties of a window. Specify only the properties that you want to change; unspecified properties will be left unchanged.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "windowId",
+ "minimum": -2
+ },
+ {
+ "type": "object",
+ "name": "updateInfo",
+ "properties": {
+ "left": {
+ "type": "integer",
+ "optional": true,
+ "description": "The offset from the left edge of the screen to move the window to in pixels. This value is ignored for panels."
+ },
+ "top": {
+ "type": "integer",
+ "optional": true,
+ "description": "The offset from the top edge of the screen to move the window to in pixels. This value is ignored for panels."
+ },
+ "width": {
+ "type": "integer",
+ "minimum": 0,
+ "optional": true,
+ "description": "The width to resize the window to in pixels."
+ },
+ "height": {
+ "type": "integer",
+ "minimum": 0,
+ "optional": true,
+ "description": "The height to resize the window to in pixels."
+ },
+ "focused": {
+ "type": "boolean",
+ "optional": true,
+ "description": "If true, brings the window to the front. If false, brings the next window in the z-order to the front."
+ },
+ "drawAttention": {
+ "type": "boolean",
+ "optional": true,
+ "description": "Setting this to <value>true</value> will cause the window to be displayed in a manner that draws the user's attention to the window, without changing the focused window. The effect lasts until the user changes focus to the window. This option has no effect if the window already has focus."
+ },
+ "state": {
+ "$ref": "WindowState",
+ "optional": true,
+ "description": "The new state of the window. The ``minimized``, ``maximized`` and ``fullscreen`` states cannot be combined with ``left``, ``top``, ``width`` or ``height``."
+ },
+ "titlePreface": {
+ "type": "string",
+ "optional": true,
+ "description": "A string to add to the beginning of the window title."
+ }
+ }
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": [
+ {
+ "name": "window",
+ "$ref": "Window"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "remove",
+ "type": "function",
+ "description": "Removes (closes) a window, and all the tabs inside it.",
+ "async": "callback",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "windowId",
+ "minimum": -2
+ },
+ {
+ "type": "function",
+ "name": "callback",
+ "optional": true,
+ "parameters": []
+ }
+ ]
+ },
+ {
+ "name": "openDefaultBrowser",
+ "type": "function",
+ "description": "Opens the provided URL in the default system browser.",
+ "async": true,
+ "parameters": [
+ {
+ "type": "string",
+ "name": "url"
+ }
+ ]
+ }
+ ],
+ "events": [
+ {
+ "name": "onCreated",
+ "type": "function",
+ "description": "Fired when a window is created.",
+ "filters": [
+ {
+ "name": "windowTypes",
+ "type": "array",
+ "items": {
+ "$ref": "WindowType"
+ },
+ "description": "Conditions that the window's type being created must satisfy. By default it will satisfy <value>['app', 'normal', 'panel', 'popup']</value>, with <value>app</value> and <value>panel</value> window types limited to the extension's own windows."
+ }
+ ],
+ "parameters": [
+ {
+ "$ref": "Window",
+ "name": "window",
+ "description": "Details of the window that was created."
+ }
+ ]
+ },
+ {
+ "name": "onRemoved",
+ "type": "function",
+ "description": "Fired when a window is removed (closed).",
+ "filters": [
+ {
+ "name": "windowTypes",
+ "type": "array",
+ "items": {
+ "$ref": "WindowType"
+ },
+ "description": "Conditions that the window's type being removed must satisfy. By default it will satisfy <value>['app', 'normal', 'panel', 'popup']</value>, with <value>app</value> and <value>panel</value> window types limited to the extension's own windows."
+ }
+ ],
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "windowId",
+ "minimum": 0,
+ "description": "ID of the removed window."
+ }
+ ]
+ },
+ {
+ "name": "onFocusChanged",
+ "type": "function",
+ "description": "Fired when the currently focused window changes. Will be :ref:`windows.WINDOW_ID_NONE`, if all windows have lost focus. **Note:** On some Linux window managers, WINDOW_ID_NONE will always be sent immediately preceding a switch from one window to another.",
+ "filters": [
+ {
+ "name": "windowTypes",
+ "type": "array",
+ "items": {
+ "$ref": "WindowType"
+ },
+ "description": "Conditions that the window's type being focused must satisfy. By default it will satisfy <value>['app', 'normal', 'panel', 'popup']</value>, with <value>app</value> and <value>panel</value> window types limited to the extension's own windows."
+ }
+ ],
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "windowId",
+ "minimum": -1,
+ "description": "ID of the newly focused window."
+ }
+ ]
+ }
+ ]
+ }
+]