Created
January 17, 2018 13:17
-
-
Save anthonybrown/6541e0d6c8241e6c03eb8325dc188714 to your computer and use it in GitHub Desktop.
Log new objects in the console
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); | |
const virgin = Object.keys(iframe.contentWindow); | |
const current = Object.keys(window); | |
const added = current.filter(key => !virgin.includes(key)); | |
console.log(added); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Disclaimer, this was written by Wes Bos not me. It's from a tweet I read this morning