Provide a way to modify displayed messages with WebExtensions
Categories
(Thunderbird :: Add-Ons: Extensions API, enhancement)
Tracking
(Not tracked)
People
(Reporter: qeole, Unassigned)
Details
I am looking at porting an add-on that changes the content of the displayed message body (the modifications are not stored or sync'ed with IMAP, the idea is just to change the message on the fly when it is displayed). The use case it to bring some syntax highlighting for diffs when working with email patches.
I experimented with TB78 but could not find a way to change the message displayed. In particular I looked at:
-
The
messageDisplay
API, which allows me to hook on message display and to retrieve its body, but apparently does not provide a way to change it. Would it make sense to extend it with agetDisplayedMessage(tabId, message)
function wheremessage
would be aMessageHeader
object to display instead of the original one? -
I also tried to execute a run a content script in the mail mail tab to directly edit the DOM for the displayed message, but I failed to do so. Injecting the script in the
mailTab
does not return me an error but does not seem to do anything either, so I guess it is not supported at the moment. Anything doable on that side?
Either one of those solutions would likely help me porting the add-on (I have a preference for the messageDisplay
API solution). Do you think one of them could be implemented? It is possible that I missed existing relevant bugs, or an existing alternative that would allow me to port the add-on, in which case pointers would be hugely appreciated.
Comment 1•4 years ago
|
||
The content script issue is already tracked in bug 1504475, so I'm marking as a duplicate of that bug.
For now, you'll need to use WebExtension experiments.
Description
•