Hello Steve 

        Sorry for the late response. I did what you suggested  ( ie register
a factory for my component declared in some parts of my main executable, and
could make it 
work, which allows me to  pass a reference to my global data to my component
)  
which works fine thanks.

Anyway, for it to be callable from javascript, I had to build a xpt file and
put it in my component dir. 

I'm not sure this is exactly what you meant when you wrote ' that provides
native interface to JS in an embedding app  '. 
Basically my component implements clsInfo, and I add the xpt to the
directory.

Is there another way ?
TIA

Philippe

-----Message d'origine-----
De :
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
lla.org] De la part de Steve Lu
Envoyé : jeudi 6 novembre 2008 14:42
À : Philippe Torrelli
Cc : [email protected]
Objet : Re: How to call the embedding application from the embedded
Javascript ?

Philippe Torrelli wrote:
> Hi there,
>
>  
>
> I'm trying to call a function of my embedding app from the javascript in
the
> embedded gecko.
>
> This is with the embedding sample from pelle Johansen, and a firefox 3.1
> build.
>   
The XRE_InitEmbedding functions lets you initialize with static modules
that provides native interface to JS in an embedding app.

Steve



>  
>
> I've been successful in calling native code from the javascript but it was
> using either the npapi, or using the category manager to make an XPcom
> object available from the dom of the embedded browser.
>
>  
>
> What I don't like with both these two approaches is  that the code
triggered
> is in a separate module
>
> and I want to use the function to consult/update the state of my embedding
> app. 
>
>  
>
> I now will try to create and register my xpcom object from the embedding
> app, so that I can pass it the data I want from the factory, but it seems
> quite a complicated solution .. 
>
>   
>
> Any hint appreciated
>
>  
>
> TIA
>
>  
>
> Philippe Torrelli
>
> _______________________________________________
> dev-embedding mailing list
> [email protected]
> https://lists.mozilla.org/listinfo/dev-embedding
>
>   

_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding

_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding

Reply via email to