Map browser DOM using Javascript
- by EddyR
I'm trying to map a browsers DOM using javascript. It should list all the functions and attributes associated with it and it should also recurse through any object attributes.
Now as I understand it 'window' is the most top-level node (although I've see a reference to 'top' as well in Chrome.) then 'document', etc. However I've never seen 'Node' under 'window' and yet I can call it. So where is 'Node' located? Is there a level above 'window' or is it a separate object (W3C says it's supposed to be inherited by 'document' only.)?
I've been playing with a function to do this but I keep getting weird results so I'm not post it here.
Alternatively - is it possible to get the properties from the object types instead of the object reference itself? for example 'DOMWindow' instead of 'window'. I think this would stop duplicating data from inherited objects.