Last active
December 11, 2015 17:29
-
-
Save konijn/4635185 to your computer and use it in GitHub Desktop.
Log in the console all globals, still will not tell you where you created the global..
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
/* Dump all 'user space' globals | |
Many thanks to glutamat: http://stackoverflow.com/questions/14585537 */ | |
void( (function() | |
{ | |
var w = document.body.appendChild( document.createElement("iframe") ).contentWindow, | |
known = | |
[ | |
"screenLeft" , "screenTop" , "scrollX" , "scrollY" , "pageYOffset" , "pageXOffset" , /* Scrolling related built-ins */ | |
"innerWidth" , "innerHeight" , "outerWidth" , "outerHeight" , /* Size related built-ins */ | |
"defaultstatus" , "defaultStatus", /* Status bar text related built-ins */ | |
"frameElement" , "length" , /* Frame related built-ins */ | |
"opener" , "event" , "status" , "name" , "closed" , "external" , /* Generic Misc. */ | |
"devicePixelRatio" , /* Webkit & Opera Misc.*/ | |
"offscreenBuffering" , /* Webkit & IE Misc. */ | |
"chrome" , "Intl" , "v8Intl" /* Webkit */ | |
], | |
list = [], i = 1; | |
for(var key in window) | |
if( window.hasOwnProperty(key) && w[key] === undefined && !~known.indexOf(key) ) | |
list.push(key); | |
list.sort().forEach( function(s){ console.log( i++ , s ) } ); | |
})()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use this as a this as a bookmarklet, this is definitely beta quality, do not use for nuclear reactors ;)