Skip to content

Instantly share code, notes, and snippets.

@AScriver
Created October 7, 2022 18:11
Show Gist options
  • Save AScriver/a1fb80bbddc96093271c014b8017c9ff to your computer and use it in GitHub Desktop.
Save AScriver/a1fb80bbddc96093271c014b8017c9ff to your computer and use it in GitHub Desktop.
Logs any properties that have been added to the Window object.
const i = document.createElement('iframe');
i.style.display = 'none';
document.body.appendChild(i);
const obj = {};
Object.keys(window)
.filter(value => Object.keys(i.contentWindow).indexOf(value) < 0)
.forEach(key => obj[key] = window[key]);
i.parentNode.removeChild(i);
console.log(obj);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment