title: HTMLImageElement - src as stream
body: <p>In the past, you could use <code>URL.createObjectURL()</code> and pass it a MediaStream. However, this has been removed (see <a href="https://www.fxsitecompat.dev/en-CA/docs/2017/url-createobjecturl-stream-has-been-deprecated/" rel="noreferrer">https://www.fxsitecompat.dev/en-CA/docs/2017/url-createobjecturl-stream-has-been-deprecated/</a>).</p>
  
  <p>The replacement functionality was to instead use <code>HTMLMediaElement.srcObject</code>. This does a good job of covering the video case.</p>
  
  <p>However, <code>HTMLImageElement</code> does not inherit from <code>HTMLMediaElement</code>. It does not have srcObject, either.</p>
  
  <p>In my specific case, I am developing a FireFox plugin that utilizes the WebRequest filter stream functionality to do image transformations. With that API I get ArrayBuffer chunks of data. I would like to be able to stream these as I receive them to an <code>Image()</code> that is decoding them on the fly rather than simply accumulating them, turning them into a Blob, and then converting into a URL via <code>URL.createObjectURL(blob)</code>.</p>
  
  <p>Is there a way I can accomplish this in a streaming fashion?</p>
  
  <p>(Note 1: I'm ok with a FireFox specific solution if need be.)</p>
  
  <p>(Note 2: I tried setting <code>HTMLVideoElement</code> src to e.g. PNG but it appears that the video element is indeed picky and only supports video formats rather than stills. If I could get <code>HTMLVideoElement.srcObject</code> to load image stills, that might make a MediaStream-based solution possible, too). </p>