Last active
August 31, 2018 09:47
-
-
Save nuxodin/fefe1c7f4277d2930cffa5893fce0ad6 to your computer and use it in GitHub Desktop.
Find custom globals variables
This file contains 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
{ | |
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