Revision control
Copy as Markdown
Other Tools
[
{
"namespace": "messageDisplay",
"permissions": ["messagesRead"],
"events": [
{
"name": "onMessageDisplayed",
"type": "function",
"max_manifest_version": 2,
"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"
},
{
"max_manifest_version": 2,
"name": "messages",
"type": "array",
"items": {
"$ref": "messages.MessageHeader"
}
},
{
"min_manifest_version": 3,
"name": "displayedMessages",
"$ref": "messages.MessageList"
}
]
}
],
"functions": [
{
"name": "getDisplayedMessage",
"max_manifest_version": 2,
"type": "function",
"description": "Gets the currently displayed message in the specified tab (even if the tab itself is currently not visible), or the currently active tab. It returns <var>null</var> if no messages are displayed, or if multiple messages are displayed.",
"async": "callback",
"parameters": [
{
"name": "tabId",
"type": "integer",
"optional": true,
"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), or the currently active tab. The array is empty if no messages are displayed.",
"async": "callback",
"parameters": [
{
"name": "tabId",
"type": "integer",
"optional": true,
"minimum": 1
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": [
{
"choices": [
{
"max_manifest_version": 2,
"type": "array",
"items": {
"$ref": "messages.MessageHeader"
}
},
{
"min_manifest_version": 3,
"$ref": "messages.MessageList"
}
]
}
]
}
]
},
{
"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": {
"$ref": "messages.MessageId",
"optional": true,
"description": "The id of a message to be opened. Will throw an <em>ExtensionError</em>, if the provided <var>messageId</var> 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 <var>headerMessageId</var> 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",
"optional": true,
"parameters": [
{
"name": "tab",
"$ref": "tabs.Tab"
}
]
}
]
}
]
}
]