開発者は XPConnect でラッパーが大きな役割を果たしていることを理解しています。あまり知らされていない開発者は、ラッパーが存在し、何らかの重要性を持っていることを理解していますが、いつラッパーを使用すべきか、ラッパーを見なければならないかはわかりません。
window.focus(), you're calling into XPCWrappedNative code.
If you call '
toString()' and get "
[xpconnect wrapped nsIFoo]" then the reference is to a
XPCWrappedNative object with interface
They are implicitly created by XPConnect and you should not have to worry about how that happens. There are several types of wrapped natives, but I won't cover those here.
These wrappers are created by XPConnect, so you should not have to worry about how to construct them or whether to construct them.
To learn about security wrappers, see the article on script security in Gecko.
Note that a previous version of the current page recommended using
__exposedProps__ to expose objects from chrome to content. This is now deprecated and we are in the process of removing support for it. If you need to make objects or functions defined in chrome code accessible to content, use Components.utils.cloneInto or Components.utils.exportFunction.