[Jslib] Uninstall UI
mnenhy at tprac.de
Sun Dec 7 05:14:18 EST 2003
Pete Collins aber hob zu reden an und schrieb:
> I was looking at getting the zip reader from nsIJARProtocolHandler:
Oh, I must have missed that one. :O :)
> But this interface doesn't seem to be used anywhere in Mozilla and
> doesn't appear to be available.
The following code works perfectly for me, doing what you told you intended:
var IOService = Components.classes["@mozilla.org/network/io-service;1"]
var handler = IOService.getProtocolHandler("jar");
if (handler instanceof Components.interfaces.nsIJARProtocolHandler)
var zrc = jph.JARCache;
var nsIZipReader = zrc.getZip(<some nsIFile zipFile>);
But since it calls getZip, I'm still not sure if that will suffice.
Guess I'll have a dig into nsJar.cpp as soon as I have time... :)
> There must be a better way to close a file handle on a jar cahced in
> memory. It seems sending the observer service and "exhausted memory"
> notice is a last resort. :)
I hope so. :)
nsIJARProtocolHandler looks very promising.
More information about the Jslib