It's not currently possible. Cu.createObjectIn uses a hardcoded JSClass (that of 'Object').
The right way to do this is to fix bug 914970, at which point you'll be able to do |new contentWindow.Foopy()| to instantiate a foopy. But that's a bit of a ways away. In the mean time, would your use-case be solved by the ability to structured-clone an object into content? We have the machinery to do that, so it would be very simple to expose on Cu. File a bug and CC me if that's the case. bholley On Wed, Sep 25, 2013 at 5:59 AM, Jan Odvarko <[email protected]> wrote: > Is there any way how to provide a type for an object that is exposed > > to content using Cu.createObjectIn(obj) ? > > > > There is a case in Firebug where such object is created > > as a return value when a command is evaluated on > > the Command Line (in scope of the current page). > > > > Consequently Firebug Console, wants to pretty-print > > that object, but can't recognize it since createObjectIn > > doesn't allow to specify a type (the return value is always > > "Object" type). > > > > Any tips? > > Honza > > _______________________________________________ > dev-platform mailing list > [email protected] > https://lists.mozilla.org/listinfo/dev-platform > _______________________________________________ dev-platform mailing list [email protected] https://lists.mozilla.org/listinfo/dev-platform

