Skip to content

Instantly share code, notes, and snippets.

@srod
Created October 24, 2018 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save srod/c1484b8d3ae8734314b8602db17cdc80 to your computer and use it in GitHub Desktop.
Save srod/c1484b8d3ae8734314b8602db17cdc80 to your computer and use it in GitHub Desktop.
List Globals Vars
(function(){
var iframe = document.createElement('iframe');
iframe.src = 'about:blank';
document.body.appendChild(iframe);
var windowVars = Object.keys(iframe.contentWindow);
var globalVars = Object.keys(window).filter(key => !windowVars.includes(key));
console.log('global Vars:', globalVars);
document.body.removeChild(iframe);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment