Created
December 4, 2019 21:42
-
-
Save wesbos/84af00ae7a368ab28b8e189f17226a20 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// get an array of all the keys on the window | |
const dirty = Object.keys(window); | |
// Then create an iframe set to nothing | |
const iframe = document.createElement('iframe'); | |
iframe.src = ''; | |
// put it into the DOM | |
document.body.append(iframe); | |
// grab an array of the clean iframe's window | |
const clean = Object.keys(iframe.contentWindow); | |
// filter the difference | |
const difference = dirty.filter(prop => !clean.includes(prop)); | |
console.log(difference); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment