Created
October 7, 2022 18:11
-
-
Save AScriver/a1fb80bbddc96093271c014b8017c9ff to your computer and use it in GitHub Desktop.
Logs any properties that have been added to the Window object.
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 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