Created
March 13, 2020 20:11
-
-
Save pinkhominid/fc3be377c13b3f039ac873a9f145e1f9 to your computer and use it in GitHub Desktop.
Is your site/app iframeable?
This file contains hidden or 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
<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