Skip to content

Instantly share code, notes, and snippets.

@nuxodin
Last active August 31, 2018 09:47
Show Gist options
  • Save nuxodin/fefe1c7f4277d2930cffa5893fce0ad6 to your computer and use it in GitHub Desktop.
Save nuxodin/fefe1c7f4277d2930cffa5893fce0ad6 to your computer and use it in GitHub Desktop.
Find custom globals variables
{
const iframe = document.createElement('iframe');
document.body.append(iframe)
setTimeout(()=>{ // wait some time until chrome adds console-accessible properties to the iframe too
const customNames = Object.getOwnPropertyNames(window).filter(item => !(item in iframe.contentWindow) );
const object = Object.create(null);
customNames.forEach(name => object[name] = window[name] )
console.log(object)
},2000);
'wait...';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment