Embedding custom objects takes too much energy the SpiderMonkey way, and it only gets harder when doing it in C#. My latest work in the spidermonkey-dotnet library has been to abstract this whole process. This is possible thanks to the reflection API and
Attributes provided by the .Net platform. The current target of this generic embedding process is the .Net API itself. Here is a screenshot of it in action:
That is a spidermonkey-dotnet shell (coming soon), executing JavaScript which creates a file and launches a modal
System.Windows.Forms.Form. Cool.