Created
February 24, 2010 21:28
-
-
Save dieseltravis/313865 to your computer and use it in GitHub Desktop.
Bookmarklet to easily enumerate a global javascript object
This file contains hidden or 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
| // enumerate an object, ex: "window" | |
| (function(){ | |
| var enumObj = function(obj) { | |
| var props = ""; | |
| for (var o in obj) { | |
| props += o; | |
| props += ": \t"; | |
| props += obj[o]; | |
| props += "\n"; | |
| } | |
| return props; | |
| }; | |
| alert(enumObj(eval(prompt("enter global reference to enumerate")))); | |
| })(); |
This file contains hidden or 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
| javascript:(function(){var%20enumObj=function(obj){var%20props="";for(var%20o%20in%20obj){props+=o;props+=":\t";props+=obj[o];props+="\n";}return%20props;};alert(enumObj(eval(prompt("enter%20global%20to%20enumerate"))));})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment