I am porting Fennec to custom hardware running an OS based on GNU/
Linux.
Hence I have modified the start-up sequence so that XRE_main is by-
passed completely. Because of this, the initial code where Fennec
extensions are detected, gets by-passed too.
I am trying to find out available extensions using following code
snippet:
PRBool needsRestart = PR_FALSE;
nsCOMPtr<nsIExtensionManager> em do_GetService("@mozilla.org/
extensions/manager;1"));
if (!em)
printf ("empty EM!\n");
else
em->Start(&needsRestart);
There are two extensions available in the extensions directory - URL-
fixer and XHTML. Unfortunately none of these get detected and I get
empty "em".
Can somebody please advise if this is a correct method and what could
possibly going wrong?
Thanks in advance!
Atul.
I'm pretty sure this is a problem for m.d.platform, setting followup-to etc.
If in this case "em" does not exist, it sounds like you didn't get the add-ons
manager to work. From what you're saying, if you bypass XRE_main, are you fully
initializing XPCOM and so on? That'd be my first guess, others will have better
info. The em should exist quite irrespective of what add-ons you have available
as such (that is, whether or not em is null does not depend on whether you have
add-ons installed). Other than that, I remember that there are some finnicky
(locale?) things your app needs to do to get the EM to work, but (a) I don't
think that was related to the service, moreso to the actual UI etc., and (b)
pretty sure Fennec gets that right, so it shouldn't be an issue.
~ Gijs