Skip to content

Instantly share code, notes, and snippets.

@mkckr0
Created February 10, 2023 07:51
Show Gist options
  • Save mkckr0/b0d81a13bb4143ad3f5432dc07525376 to your computer and use it in GitHub Desktop.
Save mkckr0/b0d81a13bb4143ad3f5432dc07525376 to your computer and use it in GitHub Desktop.
List all properties of window object
(() => {
let iframe = document.createElement('iframe')
iframe.style.display = 'none'
document.body.appendChild(iframe)
let results = {}
for (k of Object.getOwnPropertyNames(window)) {
if (iframe.contentWindow.hasOwnProperty(k)) {
continue
}
if (typeof(window[k]) === 'function') {
continue
}
results[k] = window[k]
}
document.body.removeChild(iframe)
return results
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment