Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Retrieving list of available plugins.

2 views
Skip to first unread message

Gijs Kruitbosch

unread,
Nov 24, 2009, 8:43:42 AM11/24/09
to
On 24/11/2009 13:54 PM, Atul wrote:
> Hi,
>
> 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

Atul

unread,
Nov 24, 2009, 9:05:15 AM11/24/09
to

Thanks for the quick response. I think un-initialized or poorly
initialized em is the problem here because I don't think em exists
unless I initialize it. So I will trace the problem on this trail.
Thanks!
Atul.

Atul

unread,
Nov 27, 2009, 4:32:46 AM11/27/09
to
On Nov 24, 6:43 pm, Gijs Kruitbosch <gijskruitbo...@gmail.com> wrote:

As rightly pointed out by Gijs, XPCOM initialization was the problem.
I followed similar sequence of initialization as in nsAppRunner.cpp
and now I am getting the list of extensions available.
Thanks Gijs for your help!

Atul.

0 new messages