My scenario: I am iterating over the window object and trying to retrieve only user-defined variables/functions and filtering out native browser objects.
for(var i in window) {
// Right now I just have a bunch of if checks on window[i]
}
I noticed that native browser objects/XPCOM components are wrapped via XPConnect which returns a wrapper of the object that allows it to interface with Javascript. I am thinking that if I could somehow check and see if the object is a wrapper then I can filter it out. Is there a way to check if an object is wrapped via XPConnect? I would like to filter out all objects that are wrapped as any of the wrapper types listed here: https://developer.mozilla.org/en/XPConnect_wrappers