I'm doing a Thunderbird extension that will get the stored username/password in Firefox and import those accounts into Thunderbird. This results in the need of nsILoginManager, but I'm not sure how to make it work from a Thunderbird extension. Is it possible to do so?
You pretty much cannot. In addition to XPCOM simply not working across different processes, the complications are:
The best you could do would be:
firefox -url file://foo/bar/extension.xpi
- make sure that Firefox is running and the user is asked to install extension.xpi
. It should be a bootstrapped extension so that no browser restart is required.nsILoginManager
(which involves a password prompt if the user has a master password defined) and sends it back to Thunderbird.This is far from being a smooth user experience of course. As to how the two extensions (one in Thunderbird, the other in Firefox) would communicate - TCP sockets would probably be the easiest way. The Thunderbird extension would create a server socket and wait for the Firefox extension to connect to it.