Skip to content

Instantly share code, notes, and snippets.

@ewebdev
Created January 15, 2015 13:17
Show Gist options
  • Save ewebdev/239c17e297e789f1effa to your computer and use it in GitHub Desktop.
Save ewebdev/239c17e297e789f1effa to your computer and use it in GitHub Desktop.
(function(){
var globals = [],
pageProps = {},
nativeProps = {},
v;
for (v in window) {
pageProps[v] = 1;
}
var ifrm = document.createElement("IFRAME");
document.body.appendChild(ifrm);
var iWin = ifrm.contentWindow;
for (v in iWin) {
nativeProps[v] = 1;
}
for (v in pageProps) {
if (pageProps.hasOwnProperty(v) && !nativeProps.hasOwnProperty(v)){
globals.push(v);
}
}
document.body.removeChild(ifrm);
return globals.sort();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment