Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 844
John Gallagher Avatar asked Feb 22 '10 11:02

John Gallagher


1 Answers

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.

like image 133
John Gallagher Avatar answered Nov 17 '22 03:11

John Gallagher