messageDisplayScripts API
This message display scripts API is the same as the content scripts API except that it works on the document of email messages being displayed.
See also executeScript, insertCSS, removeCSS, and composeScripts API.
Note
Registering a message display script in the manifest.json file is not possible at this point.
Permissions
Read and modify your email messages as they are displayed to you
Transfer sensitive user data (if access has been granted) to a remote server for further processing
Functions
register(messageDisplayScriptOptions)
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
Required permissions
Types
RegisteredMessageDisplayScript
An object that represents a message display script registered programmatically
object
unregister()
Unregister a message display script registered programmatically
RegisteredMessageDisplayScriptOptions
Details of a message display script registered programmatically
object
The list of CSS files to inject
The list of JavaScript files to inject
[runAt
]
(string, optional)
Determines when the files specified in css and js are injected. The states directly correspond to Document.readyState: loading, interactive and complete
Supported values:
document_start
document_end
document_idle
External Types
The following types are not defined by this API, but by the underlying Mozilla WebExtension code base. They are included here, because there is no other public documentation available.
ExtensionFileOrCode
Specify code, either by pointing to a file or by providing the code directly. Only one of the two is allowed.
object
code
(string)
Some JavaScript code to register.
file
(string)
A URL starting at the extension’s manifest.json and pointing to a JavaScript file to register.