Last active
December 17, 2015 09:29
-
-
Save tmtk75/5587683 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var toValue = function(it) { | |
if (typeof it == "string") | |
return "'" + it + "'"; | |
if (it.constructor === Array) | |
return "Array[" + it.length + "]"; | |
return it; | |
} | |
var showProperties = function(p, obj, indent) { | |
if (typeof obj == "function") { | |
return; | |
} | |
if (typeof obj == "object" && obj.constructor !== Array) { | |
for (var p in obj) { | |
if (obj.hasOwnProperty(p)) | |
showProperties(p, obj[p], indent + " "); | |
} | |
return; | |
} | |
console.log(indent + p + ":", toValue(obj)); | |
} | |
var page = new WebPage | |
showProperties("WebPage", page, ""); | |
phantom.exit(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment