views:

735

answers:

1

Background

I want to access the cache of Chrome and Firefox in my Cocoa application. I need to get the HTML for pages accessed recently. Safari is a piece of cake - all this information is available in SQLite data stores, but not so in Chrome and Firefox.

The Problem

For Firefox, the cache is in /Library/Caches/Firefox/Profiles/xxx.default/Cache with filenames _CACHE_001_ _CACHE_002_ _CACHE_003_ and _CACHE_MAP_

For Chrome, the cache is in /Library/Caches/Google/Chrome/Default/Cache with filenames data_0 data_1 data_2 and data_3

What I've tried

The only article I can find that sheds any light on what format these caches are in is here. It recommends a Cache Viewer tool, but doesn't explain how one might do this programmatically.

Questions

  1. Is there any way of reconstructing this data using command line tools or the Cocoa framework? Or is it much too low level?

  2. Is there another way of getting at the HTML of recent web pages that I don't know about?

A: 

The only solution I can see is that suggested by Ole above, namely to look at the code from Chrome and Firefox and work out how they encode the cache.

I've since realised this is a huge coding challenge fraught with difficulties. I'm ditching this functionality and trying a simpler way.

John Gallagher
Can you script Firefox / Chrome and use that to expose their internal API to your application? Perhaps installing a Firefox plugin that reads the cache and writes metadata that your app understands?
adib