messageDisplayScripts 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.
messagesModify
Read and modify your email messages as they are displayed to you.
Functions
register(messageDisplayScriptOptions)
– [Added in TB 82]
Register a message display script programmatically.
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([tabId], details) for each of the open messageDisplay tabs.
Parameters
messageDisplayScriptOptions
Required permissions
Types
ExtensionFileOrCode
Specify code, either by pointing to a file or by providing the code directly. Only one of the two is allowed.
object
file
A URL relative to the extension’s manifest.json file, and pointing to a JavaScript file to register.
or
object
code
A string of JavaScript code to register.
ExtensionURL
A path relative to the root of the extension.
string
RegisteredMessageDisplayScript
– [Added in TB 82]
An object that represents a message display script registered programmatically
object
RegisteredMessageDisplayScriptOptions
– [Added in TB 82]
Details of a message display script registered programmatically
object
css
The list of CSS files to inject
js
The list of JavaScript files to inject
runAt