Re: jar protocol

On 07/05/2013 20:57 , Jonas Sicking wrote:
> Will this let us support reading things from blob: URLs where the Blob
> contains a zip file? I.e. what Gecko would support as
> jar:blob:abc-123!/img/foo.jpg.


var blob = new Blob(zipContent, { type: "application/bundle" })
,   burl = URL.createObjectURL(blob);
$("<link rel='bundle'>").attr("href", burl).appendTo($("head"));
someImg.src = burl + "/img/foo.jpg";

It might be a little bit more convoluted than desired. If it's a common 
operation we could add a convenience method for it. That could become:

var burl = URL.registerBundle(zipInABlob);
someImg.src = burl + "/img/foo.jpg";

But I'm not sure that's worth it just yet.

> Also note that while we're using "jar" as scheme name, it's simply
> just zip support. None of the other pieces of the jar spec is used.

How do you figure out media types? Is it just sniffing, or do you have 
some sort of file extensions mapping as well?

Robin Berjon - - @robinberjon

Received on Thursday, 9 May 2013 16:03:17 UTC