开发者

Firefox download already cached file

开发者 https://www.devze.com 2023-04-02 09:40 出处:网络
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

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

精彩评论

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