Created
March 23, 2019 13:46
-
-
Save rcherny/486184a02a8d5cd9798705a247b225d9 to your computer and use it in GitHub Desktop.
Find the globals defined by the current page on window
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
// find the globals defined by the current page | |
(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