开发者

Firefox download already cached file

For MS IE, I can dig out a already downloaded file from the browser cache, with this WIN32 API

DownloadFile = URLDownloadToFile(0&, sSourceUrl, sLocalFile, 0, 0) = ERROR_SUCCESS

Is there a simple way for F开发者_运维问答irefox?

How does Firefox store the link between the original URL and the cache filename?

places.sqlite? which tables and columns?


You call nsICacheService.createSession(), then nsICacheSession.openCacheEntry() on the result. Basically, it's the same code as in How to get images from cache using a XPCOM Component in Firefox but clientID should be "http" rather than "image" (you want to look at the HTTP browsing cache rather than the image cache).

At least that's how you do it from inside Firefox. I suspect that you want to read the cache from an independent application - well, good luck replicating Firefox code. http://mxr.mozilla.org/mozilla-central/source/netwerk/cache/nsDiskCacheMap.cpp should be a good starting point.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜