Can't use Blob as source to iframe (can in Safari, Chrome, Firefox)

Fixed Issue #9121088

Details

Author
G M.
Created
Sep 29, 2016
Privacy
This issue is public.
Found in
  • Microsoft Edge
Reports
Reported by 3 people

Sign in to watch or report this issue.

Steps to reproduce

Here’s a fiddle showing the issue

https://jsfiddle.net/greggman/r6mw8a9w/

Otherwise you can run this code below

This feature is useful for making a 100% client side codepen/jsfiddle code editor for examples. Without it a server is needed to serve the latest source for the iframe

<h1>IFrame Below uses blob as content</h1>
<iframe></iframe>
<p>works in Chrome, Safari, Firefox. Used for Codepen like editor without needing a server</p>
<script>
var html = `
<style>
body { 
  background: blue; 
  color: white;
}
</style>
<h1>This is Blob Content</h1>
`;

var blob = new Blob([html], {type: 'text/html'});
var iframe = document.querySelector("iframe");
iframe.src = URL.createObjectURL(blob);
</script>

Attachments

0 attachments

    Comments and activity

    • If you’re curious here’s the site. Note the code editors will not show up on edge because of the issue above I had to check for edge and disable them. Use Chrome/Safari/Firefox and they should work

    • Microsoft Edge Team

      Changed Assigned To to “Ibrahim O.”

      Changed Assigned To to “Travis L.”

      Changed Status to “Fixed”

    You need to sign in to your Microsoft account to add a comment.

    Sign in