Revision control

Copy as Markdown

Other Tools

// 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": ["sensitiveDataUpload"]
}
]
}
]
},
{
"namespace": "scripting.compose",
"permissions": ["compose"],
"types": [
{
"id": "ComposeScriptDetails",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The id of the compose script, specified in the API call."
},
"js": {
"type": "array",
"optional": true,
"description": "The list of JavaScript files to be injected. These are injected in the order they appear in this array.",
"items": { "$ref": "manifest.ExtensionURL" }
},
"runAt": {
"$ref": "extensionTypes.RunAt",
"optional": true,
"description": "Specifies when JavaScript files are injected. The preferred and default value is <code>document_idle</code>."
},
"css": {
"type": "array",
"optional": true,
"description": "The list of CSS files to be injected. These are injected in the order they appear in this array.",
"items": { "$ref": "manifest.ExtensionURL" }
}
}
},
{
"id": "ComposeScriptFilter",
"type": "object",
"properties": {
"ids": {
"type": "array",
"optional": true,
"description": "The IDs of specific compose scripts to retrieve with <code>getRegisteredScripts()</code> or to unregister with <code>unregisterScripts()</code>.",
"items": { "type": "string" }
}
}
}
],
"functions": [
{
"name": "getRegisteredScripts",
"type": "function",
"description": "Returns all registered compose scripts for this extension that match the given filter.",
"async": "callback",
"parameters": [
{
"name": "filter",
"$ref": "ComposeScriptFilter",
"optional": true,
"description": "An object to filter the extension's registered compose scripts."
},
{
"name": "callback",
"type": "function",
"description": "The resulting array contains the registered compose scripts.",
"parameters": [
{
"name": "scripts",
"type": "array",
"items": { "$ref": "ComposeScriptDetails" }
}
]
}
]
},
{
"name": "registerScripts",
"type": "function",
"description": "Registers one or more compose scripts for this extension, which should be injected into the message compose editor. **Note:** Registered scripts will only be applied to newly opened message compose tabs. To apply the script to already open message compose tabs, manually inject your script by calling $(ref:scripting.executeScript) for each of the open <var>messageCompose</var> tabs.",
"async": "callback",
"parameters": [
{
"name": "scripts",
"type": "array",
"description": "Contains a list of compose scripts to be registered. If there are errors during script parsing/file validation, or if the IDs specified already exist, then no scripts are registered.",
"items": { "$ref": "ComposeScriptDetails" }
},
{
"name": "callback",
"type": "function",
"description": "Invoked upon completion of the registration.",
"parameters": []
}
]
},
{
"name": "unregisterScripts",
"type": "function",
"description": "Unregisters one or more compose scripts for this extension.",
"async": "callback",
"parameters": [
{
"name": "filter",
"$ref": "ComposeScriptFilter",
"optional": true,
"description": "If specified, only unregisters compose scripts which match the filter. Otherwise, all of the extension's compose scripts are unregistered."
},
{
"name": "callback",
"type": "function",
"description": "Invoked upon completion of the unregistration.",
"parameters": []
}
]
}
]
},
{
"namespace": "scripting.messageDisplay",
"permissions": ["messagesRead"],
"types": [
{
"id": "MessageDisplayScriptDetails",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The id of the message display script, specified in the API call."
},
"js": {
"type": "array",
"optional": true,
"description": "The list of JavaScript files to be injected. These are injected in the order they appear in this array.",
"items": { "$ref": "manifest.ExtensionURL" }
},
"runAt": {
"$ref": "extensionTypes.RunAt",
"optional": true,
"description": "Specifies when JavaScript files are injected. The preferred and default value is <code>document_idle</code>."
},
"css": {
"type": "array",
"optional": true,
"description": "The list of CSS files to be injected. These are injected in the order they appear in this array.",
"items": { "$ref": "manifest.ExtensionURL" }
}
}
},
{
"id": "MessageDisplayScriptFilter",
"type": "object",
"properties": {
"ids": {
"type": "array",
"optional": true,
"description": "The IDs of specific message display scripts to retrieve with <code>getRegisteredScripts()</code> or to unregister with <code>unregisterScripts()</code>.",
"items": { "type": "string" }
}
}
}
],
"functions": [
{
"name": "getRegisteredScripts",
"type": "function",
"description": "Returns all registered message display scripts for this extension that match the given filter.",
"async": "callback",
"parameters": [
{
"name": "filter",
"$ref": "MessageDisplayScriptFilter",
"optional": true,
"description": "An object to filter the extension's registered message display scripts."
},
{
"name": "callback",
"type": "function",
"description": "The resulting array contains the registered message display scripts.",
"parameters": [
{
"name": "scripts",
"type": "array",
"items": { "$ref": "MessageDisplayScriptDetails" }
}
]
}
]
},
{
"name": "registerScripts",
"type": "function",
"description": "Registers one or more message display scripts for this extension, which should be injected into displayed messages. **Note:** Registered scripts will only be applied to newly opened messages. To apply the script to already open messages, manually inject your script by calling $(ref:scripting.executeScript) for each of the open <var>messageDisplay</var> tabs.",
"async": "callback",
"parameters": [
{
"name": "scripts",
"type": "array",
"description": "Contains a list of message display scripts to be registered. If there are errors during script parsing/file validation, or if the IDs specified already exist, then no scripts are registered.",
"items": { "$ref": "MessageDisplayScriptDetails" }
},
{
"name": "callback",
"type": "function",
"description": "Invoked upon completion of the registration.",
"parameters": []
}
]
},
{
"name": "unregisterScripts",
"type": "function",
"description": "Unregisters one or more message display scripts for this extension.",
"async": "callback",
"parameters": [
{
"name": "filter",
"$ref": "MessageDisplayScriptFilter",
"optional": true,
"description": "If specified, only unregisters message display scripts which match the filter. Otherwise, all of the extension's message display scripts are unregistered."
},
{
"name": "callback",
"type": "function",
"description": "Invoked upon completion of the unregistration.",
"parameters": []
}
]
}
]
}
]