-
-
Save jakearchibald/412a93e38d0b61642d52b3490136128b to your computer and use it in GitHub Desktop.
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
<!DOCTYPE html> | |
<body> | |
<script> | |
(() => { | |
const iframe = document.createElement('iframe'); | |
document.body.appendChild(iframe); | |
iframe.onload = () => { | |
iframe.contentDocument.write('<streaming-element>'); | |
document.body.appendChild( | |
iframe.contentDocument.querySelector('streaming-element') | |
); | |
iframe.contentDocument.write('<script>console.log("Inline script")<\/script>'); | |
iframe.contentDocument.write('<script src="script.js"><\/script>'); | |
iframe.contentDocument.write('</streaming-element>'); | |
iframe.contentDocument.close(); | |
}; | |
iframe.src = ''; | |
})() | |
</script> | |
</body> |
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
console.log('External script'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment