WebExtensions needs a "new mail arrived" event
Categories
(Thunderbird :: Add-Ons: Extensions API, enhancement)
Tracking
(Not tracked)
People
(Reporter: darktrojan, Assigned: darktrojan)
References
Details
Attachments
(1 file)
7.45 KB,
patch
|
mkmelin
:
review+
|
Details | Diff | Splinter Review |
Comment 1•4 years ago
|
||
I agree on the matter. At the moment I have to use WebExtension Experiment API and to use
Cc["@mozilla.org/messenger/msgnotificationservice;1"].getService(Ci.nsIMsgFolderNotificationService)
in implementation.js
in order to subscribe to the event.
It would be nice if browser.messages
, for example, were extended with the events related to received / sent messages and an ability to access at least MessageHeader of the message in a callback.
Comment 2•4 years ago
|
||
P. S. Actually, after grepping comm-central, I started to use MailServices.mfn
and context.extension.messageManager.convert
to implement the event only and to do the rest in background.js
but nonetheless.
I would be keen to get this API too.
Thanks Alexander for the workaround. I only started to have a look to Thunderbird WebExtension today so using MailServices.mfn
and context.extension.messageManager.convert
for me are still not clear yet but I will figure out.
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 4•3 years ago
|
||
I've wrapped this around nsIMsgFolderListener.msgsClassified
which seems to be the most reliable way to get the messages in question (and only those messages). I started out with the various biff notifications but that just wasn't good enough for this use.
Is my description in messages.json accurate? I based it on the comments in nsIMsgFolderListener.idl but I'm not sure if I've understood it correctly.
Comment 5•3 years ago
|
||
Comment on attachment 9131811 [details] [diff] [review] 1599380-new-mail-received-1.diff Review of attachment 9131811 [details] [diff] [review]: ----------------------------------------------------------------- r=mkmelin ::: mail/components/extensions/parent/ext-messages.js @@ +64,5 @@ > +/** > + * Listens to the folder notification service for new messages, which are > + * passed to the onNewMailReceived event. > + * > + * @implements nsIMsgFolderListener I think it should be wrapped in angle braces @implements {nsIMsgFolderListener}
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/2679ad2daf98
WebExtensions API event for when new mail arrives. r=mkmelin
Assignee | ||
Updated•3 years ago
|
Description
•