Skip to content

Instantly share code, notes, and snippets.

@wesbos
Created December 4, 2019 21:42
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wesbos/84af00ae7a368ab28b8e189f17226a20 to your computer and use it in GitHub Desktop.
Save wesbos/84af00ae7a368ab28b8e189f17226a20 to your computer and use it in GitHub Desktop.
// 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