In modern browsers Object.getOwnPropertyNames()
and Object.getPrototypeOf()
will help you get all properties of all objects in the prototype chain.
var obj = window;
do Object.getOwnPropertyNames(obj).forEach(function(name) {
console.log(name);
});
while(obj = Object.getPrototypeOf(obj));
If you want to see the separation of the prototype objects, then add a line that provides a divider.
var obj = window;
do {
Object.getOwnPropertyNames(obj).forEach(function(name) {
console.log(name);
});
console.log("=============================");
} while(obj = Object.getPrototypeOf(obj));
I do think I recall that in Firefox, some globals don't appear until you access them. You may need to do a little experimenting if you find that to be the case.