Created
July 29, 2017 21:10
-
-
Save rdillmanCN/069b3f304d672f7c1a6e676c195d2148 to your computer and use it in GitHub Desktop.
Get a list of globals added to 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
(function iffe() { | |
var body = document.body; | |
var frm = document.createElement('iframe') | |
body.appendChild(frm); | |
function checkFrm(i) { | |
return !!frm.contentWindow[i] && i !== 'checkFrm'; | |
} | |
var result = Object.keys(window).filter(checkFrm); | |
body.removeChild(frm); | |
console.log(result); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment