Three Monkeys, Three Typewriters, Two Days

June 9, 2006

ZIP/JAR/XPI file handling

Now that we can do directory listings for ZIP files, what I'd love is for the helper app dialog for such files to offer an "open in browser" option that would just dump the file to local disk and then run jar:file:///whatever!/. I'm getting a little tired of copying and pasting the URL and adding "jar:" and "!/" to it.

Posted by bzbarsky at June 9, 2006 9:29 PM
Comments

How about a right-click menu item to navigate inside a JAR/XPI/ZIP? That could be done as a fairly simple extension too.

Posted by: Darin Fisher on June 10, 2006 12:50 AM

I want it to just open as the listing by default and have a great big "Save to disk" button, myself. That one might be better as an extension, though.

Posted by: dolphinling on June 10, 2006 9:21 PM

Yes I've been thinking this too. I don't know the architecture of a zip file, but can a list of contents be retrieved without downloading the entire file? If so, an "Archive Preview" feature would be something I'd love. You could peek inside the archive first, before deciding whether or not to download it. Also being able to directly open the contents in the browser by using the jar: protocol is super too, and an easy way to do this would be much appreciated.

Posted by: Dan Cater on June 11, 2006 7:09 AM

Likewise, it would be a nice (similar) feature if one could open any file in as if it were plain text (or XML), even though it has a MIME-type that is handled by another application.

It is sometimes nice to be able to view the source of simple text- or XML-based file types in a browser window.

Posted by: Christian Schmidt on June 11, 2006 8:07 AM

Your idea (and mine) seems related to bug 121498:
https://bugzilla.mozilla.org/show_bug.cgi?id=121498

Posted by: Christian Schmidt on June 11, 2006 8:19 AM

Darin, that would work, yes, if we could tell what files are ZIP files from the links (which we generally can't). And if we ignore ZIP files that are responses to POST requests...

dolphinling, that would probably be a bit too invasive (in particular, it would break XPI installs, no?)

Dan, in the ZIP format the directory structure is stored at the end of the archive. It might be possible to download just the directory structure with Range requests, but maybe not.

Christian, I'm well aware of bug 121498 (and more precisely of bug 57342). It's not really related to what I was talking about, because we _don't_ want to pump the original ZIP data into a docshell; we want to save it to a local file and then load the relevant jar: URI in the docshell.

Posted by: Boris on June 11, 2006 10:49 AM

As far as I know it is possible to download just the directory structure, various utilities like http://www.loadscout.com/features.shtml and http://www.canyonsw.com/bnz.htm purport to do it.

Posted by: Justin Kerk on June 12, 2006 9:52 PM

I updated http://www.squarefree.com/userscripts/bug-attachment-source.user.js to add a "contents" link for zip attachments in Bugzilla.

Posted by: Jesse Ruderman on June 21, 2006 5:40 PM
Post a comment