Hi friends,
In Firefox we use the gBrowser.selectedBrowser.messageManager to be capable of using the sendAsyncMessage function to communicate to a proper script.
How do we get a messageManager in Thunderbird? The window.messageManager supports only nsIMessageBroadcaster, so there's no way to send a message to specific script using sendAsyncManager.
My solution is:
var emailMessageManager = window.messageManager.getChildAt(0);
emailMessageManager.sendAsyncMessage(...)
I wonder if there is a proper way to obtain this messageManager?
Thunderbird: getting messageManager for currently displayed
-
- Posts: 20
- Joined: July 9th, 2007, 9:16 am
-
- Posts: 3664
- Joined: September 15th, 2010, 9:03 am
Re: Thunderbird: getting messageManager for currently displa
This is a proper way. Is it always child zero that you want?
You can get individual browsers in Thunderbird. Do they not have a messageManager property defined? If not then something like this might work:
Sorry, I haven't done this in Thunderbird so I have no idea if that makes sense.
You can get individual browsers in Thunderbird. Do they not have a messageManager property defined? If not then something like this might work:
Code: Select all
aBrowser.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader.messageManager;
-
- Posts: 20
- Joined: July 9th, 2007, 9:16 am
Re: Thunderbird: getting messageManager for currently displa
Thanks, lithopsian
You gave me a hint. That was really easy:
You gave me a hint. That was really easy:
Code: Select all
var msgMgr = window.getBrowser().messageManager;
-
- Posts: 3664
- Joined: September 15th, 2010, 9:03 am
Re: Thunderbird: getting messageManager for currently displa
Ah, so the browser does have a messageManager property in Thunderbird. That's good.