Skip to content

Instantly share code, notes, and snippets.

@nolanlawson
Created August 25, 2017 18:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nolanlawson/2adfc509329945684dc22614f767ce8d to your computer and use it in GitHub Desktop.
Save nolanlawson/2adfc509329945684dc22614f767ce8d to your computer and use it in GitHub Desktop.
iframe blob uri 2
<!doctype html>
<html lang="en">
<body>
<script>
(function () {
var theIframe = document.createElement('iframe')
theIframe.sandbox = ''
var html = '<html><h1>hello world!</h1></html>'
var blob = new Blob([html], {type: 'text/html'})
var url = URL.createObjectURL(blob)
theIframe.src = url
document.body.appendChild(theIframe)
})()
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment