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/Chr开发者_运维知识库ome/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
Is there any way of reconstructing this data using command line tools or the Cocoa framework? Or is it much too low level?
Is there another way of getting at the HTML of recent web pages that I don't know about?
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.
精彩评论