How do I read the cache of Chrome and Firefox programmatically on the Mac?

Posted by John Gallagher on Stack Overflow See other posts from Stack Overflow or by John Gallagher
Published on 2010-02-22T11:21:57Z Indexed on 2010/04/03 17:23 UTC
Read the original article Hit count: 274

Filed under:
|
|
|
|

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?

© Stack Overflow or respective owner

Related posts about google-chrome

Related posts about firefox