Hello,
Just wonder why not use "navigator.myExtension = window.myExtension" in the JS 
file?


-----Original Message-----
From: Crosswalk-help 
[mailto:[email protected]] On Behalf Of Thiago 
Marcos P. Santos
Sent: Tuesday, October 28, 2014 10:32 PM
To: Iovene, Salvatore; crosswalk-help
Subject: Re: [Crosswalk-help] Android Extensions: how do I export objects to 
navigator?

On 23-10-2014 11:40, Iovene, Salvatore wrote:
> Hi,
> If in my extension's JS file I add objects to the `exports` object, 
> they get added to `window.myExtension`.
>
> So `exports.foo = something` means that a user of my extension will be 
> able to use `window.myExtension.foo`.
>
> However, I'd like to export things to the `navigator` object, as it's 
> required from the specification I'm implementing.
>
> Is there a way to do that?
>

On the C extensions [1] you just do navigator.foo = function() {}

and set a entry point at "navigator.foo". Extensions are dynamically loaded 
when the user touches the extension namespace (i.e. 
window.myExtension). If you have an entry point outside the extension namespace 
you have to explicitly declare it.

I suppose that the Android extensions have a similar interface for that.

[1] xwalk/extensions/test/multiple_entry_points_extension.c

Br,

_______________________________________________
Crosswalk-help mailing list
[email protected]
https://lists.crosswalk-project.org/mailman/listinfo/crosswalk-help
_______________________________________________
Crosswalk-help mailing list
[email protected]
https://lists.crosswalk-project.org/mailman/listinfo/crosswalk-help

Reply via email to