scripting.messageDisplay API
Permissions
The following permissions influence the behavior of the API. Depending on which permissions are requested, additional methods might be available, or certain data may be included in responses.
Hint
Request permissions only when needed. Unnecessary requests may result in rejection during ATN review.
messagesRead
Read your email messages.
Functions
getRegisteredScripts([filter])
– [Added in TB 128]
Returns all registered message display scripts for this extension that match the given filter.
Parameters
filter
An object to filter the extension’s registered message display scripts.
Required permissions
registerScripts(scripts)
– [Added in TB 128]
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 executeScript(injection) for each of the open messageDisplay tabs.
Parameters
scripts
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.
Required permissions
unregisterScripts([filter])
– [Added in TB 128]
Unregisters one or more message display scripts for this extension.
Parameters
filter
If specified, only unregisters message display scripts which match the filter. Otherwise, all of the extension’s message display scripts are unregistered.
Required permissions
Types
ExtensionURL
A path relative to the root of the extension.
string
MessageDisplayScriptDetails
– [Added in TB 128]
object
id
The id of the message display script, specified in the API call.
css
The list of CSS files to be injected. These are injected in the order they appear in this array.
js
The list of JavaScript files to be injected. These are injected in the order they appear in this array.
runAt
MessageDisplayScriptFilter
– [Added in TB 128]
object
ids
The IDs of specific message display scripts to retrieve with getRegisteredScripts() or to unregister with unregisterScripts().
RunAt
– [Added in TB 45]
The soonest that the JavaScript or CSS will be injected into the tab.