Skip to content

Instantly share code, notes, and snippets.

@pinkhominid
Created March 13, 2020 20:11
Show Gist options
  • Save pinkhominid/fc3be377c13b3f039ac873a9f145e1f9 to your computer and use it in GitHub Desktop.
Save pinkhominid/fc3be377c13b3f039ac873a9f145e1f9 to your computer and use it in GitHub Desktop.
Is your site/app iframeable?
<style>
body {
margin: 0;
min-height: 100vh;
display: flex;
flex-direction: column;
}
iframe { flex-grow: 1 }
</style>
<script type=module>
const iframe = document.querySelector('iframe')
const input = document.querySelector('input')
document.querySelector('form').addEventListener('submit', evt => {
evt.preventDefault()
iframe.src = input.value
})
</script>
<h1>Is your site/app iframeable?</h1>
<form><label>iframe src=</label> <input value=https://wikipedia.com></form>
<iframe src=https://wikipedia.com></iframe>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment