Potentially recover 'lost' web browser text area input

Dec 15, '05 06:30:00AM

Contributed by: hayne

It sometimes happens to me that I have entered a lot of text in a text entry area on a web page, and then somehow I lose the page before submitting it to the server. Perhaps Safari crashes, I accidentally close that tab, etc. This "lost text" is often recoverable from the web browser's cache files.

For example, Safari keeps its cache files in various sub-folders of the ~/Library: Caches: Safari folder. If I recall some particular word or phrase from the text I lost, I can use the Unix grep command to search these folders for the cache file containing the text. For example, if I recall that the text contained the phrase random number then this command...

grep -r "random number" ~/Library/Caches/Safari
...will show which cache files contain that phrase.

A previous hint talked about using the cache files for viewing pages while offline. That hint said that you could drag a cache file to Safari to view the page -- but this doesn't seem to work any more, at least not as of Safari 2.0.2 on OS X 10.4.3.

However, you can recover the text by viewing the cache files in a text editor (e.g. TextEdit, TextWrangler). The text will need some minor editing -- for example, some characters (e.g. double-quotes) will have been transformed into their HTML entity form (e.g. "). But that beats retyping the entire thing, especially if you were working on a lengthy writeup.

This hint may or may not work with other browsers, depending on how they store their cache files...

Comments (7)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20051215063042481