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

Extensions in embedded Xulrunner

24 views
Skip to first unread message

mikhail....@gmail.com

unread,
Jul 7, 2006, 2:07:54 PM7/7/06
to
Hello,

I'm embedding Xulrunner trunk and want to have the spellcheck extension
enabled. It is compiled and installed, but its provided object
(nsIInlineSpellChecker) is unavailable to be created by contract.
I know about the NS_XRE_ENABLE_EXTENSION_MANAGER flag for nsXREAppData,
but there seems to be no way to pass it to XRE_InitEmbedded. Is it
impossible to enable extensions in the embedded Xulrunner engine? Can
the XRE_EXTENSIONS_DIR_LIST directory service key affect this behavior?

Michal Ceresna

unread,
Jul 7, 2006, 6:53:32 PM7/7/06
to dev-em...@lists.mozilla.org
On Friday 07 July 2006 20:07, mikhail....@gmail.com wrote:
Hello,

> I know about the NS_XRE_ENABLE_EXTENSION_MANAGER flag for nsXREAppData,
> but there seems to be no way to pass it to XRE_InitEmbedded.

the extension manager can be either enabled programmatic with setting
the field 'flags' in nsXREAppData passed to XRE_main

or in application.ini:

[App]
;Vendor=
Name=ChatZilla
Version=0.9.73
BuildID=2006042111
;Copyright=
ID={59c81df5-4b7a-477b-912d-4e0fdf64e5f2}

[Gecko]
MinVersion=1.8
MaxVersion=1.9

[XRE]
EnableExtensionManager=true

Michal

application.ini

mikhail....@gmail.com

unread,
Jul 11, 2006, 1:09:50 PM7/11/06
to

Michal Ceresna писал(а):

> On Friday 07 July 2006 20:07, mikhail....@gmail.com wrote:
> Hello,
>
> > I know about the NS_XRE_ENABLE_EXTENSION_MANAGER flag for nsXREAppData,
> > but there seems to be no way to pass it to XRE_InitEmbedded.
>
> the extension manager can be either enabled programmatic with setting
> the field 'flags' in nsXREAppData passed to XRE_main
>
> or in application.ini:

Both ways seem to be available only in xulrunner-as-application
deployment (XRE_main or the xulrunner binary), but not in embedded
libxul DLL/DSO initialized with XRE_InitEmbedded. Am I wrong?

Benjamin Smedberg

unread,
Jul 11, 2006, 1:29:02 PM7/11/06
to

All 'extension management' does is configure directory service providers
with a list of extension directories, and restart the application in certain
circumstances. If you are using XRE_InitEmbedding you will need to provide
the list of extension directories yourself, and manage restarting for
extension installation (obviously xulrunner can't know how to restart your
embedded application).

See http://lxr.mozilla.org/mozilla/source/toolkit/xre/nsXULAppAPI.h#155

and the extension manager logic at
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/toolkit/xre/nsAppRunner.cpp&rev=1.138&mark=2280-2302#227

--BDS

Michal Ceresna

unread,
Jul 12, 2006, 5:05:10 PM7/12/06
to dev-em...@lists.mozilla.org
On Tuesday 11 July 2006 19:29, Benjamin Smedberg wrote:
Hello,

I've had exactly the same problem, thank you for pointing out
that I am not the only one :-).

As suggested, for enabling of extensions I had to re-implement
some parts of the nsAppRunner.cpp
Later, if you will want profile selection on startup, you will again
have to re-implement the next part, and so on...

It is quite inconvenient that every embedding application has
to do it on its own :-(

There is a method 'XRE_main' exposed in the XULRunner
API that does almost all you need, except of communicating back
to the caller that a restart is needed. Rather it tries to relaunch the
application by itself.

I posted a bug with a patch to javaxpcom hoping that it opens
some discussion on this point and helps to simplify this usage pattern,
but there was no response :(
https://bugzilla.mozilla.org/show_bug.cgi?id=343039

Michal

0 new messages