Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

14
  • 2
    For AngularJS 1.x apps, you can build an array of Urls as they are created and then clean them up in the $onDestroy function of the component. This is working great for me. Commented Sep 6, 2016 at 18:12
  • 3
    Other answers led to Failed: network error in Chrome. This one works well. Commented Sep 27, 2017 at 19:25
  • 6
    This worked for me in Chrome (73.0.3683.86), Firefox (66.0.2), IE11 (11.379.17763.0) and Edge (44.17763.1.0). Commented Mar 29, 2019 at 8:41
  • 8
    For those looking to avoid garbage collection on the URL or strange behavior, just declare your blob like this: const url = URL.createObjectURL(blob, { oneTimeOnly: true }). You can always save the blob and generate a new Url later if needed. Commented May 1, 2020 at 21:10
  • 7
    Consider adding elem.style.display = 'none'; before document.body.appendChild(elem); if you want to avoid any potential for visual glitches Commented Jul 29, 2020 at 21:30