Skip to content

Instantly share code, notes, and snippets.

@gnbaron
Created May 18, 2021 16:52
Show Gist options
  • Save gnbaron/45bc0ca5a11f47db722fa815797f3b23 to your computer and use it in GitHub Desktop.
Save gnbaron/45bc0ca5a11f47db722fa815797f3b23 to your computer and use it in GitHub Desktop.
Check attributes added to window object.
function getAttrs() {
const iframe = document.createElement('iframe')
document.body.appendChild(iframe)
return Object.entries(window)
.filter(([k]) => !(k in iframe.contentWindow))
.reduce((acc, [k, v]) => ({ ...acc, [k]: v }), {})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment