Join MDN and developers like you at Mozilla's View Source conference, 12-14 September in Berlin, Germany. Learn more at https://viewsourceconf.org

XPCNativeWrapper

importXPCNative

importXPCNative is not documented.

0003: zz=XPCNativeWrapper(document.implementation); zz.importXPCNative('hasFeature') Caught exception: “TypeError: zz.importXPCNative is not a function�?

and you can't work around it:

0003: XPCNativeWrapper.prototype.importXPCNative=function(){} Caught exception: “Error: XPCNativeWrapper.prototype.importXPCNative is read-only�?

(unsigned, by timeless)

Setting expando properties accessible from content

It's not clear from the text in what sense it's not "safe" to set expandos via wrappedJSObject. I intend to add something like this to the paragraph, but I need to check the implications of this [the page's ability to run code in the setter] with brendan/mrbkap (as suggested by bz): --Nickolay 16:26, 10 September 2006 (PDT)

* - You can assign to a property on the wrapper's wrappedJSObject, but it may end up running the setter defined by the page instead of actually setting the property. This may lead to a security hole and should be avoided.


instanceof

How should one identify the wrapped object type if instanceof doesn't work? How perform a safe check that may work in any case?

Document Tags and Contributors

 Contributors to this page: Akiross, Nickolay, Timeless
 Last updated by: Akiross,