While I was just creating a blog post on this site, Firefox decided to die horribly. No worries, right? I’m running Ubuntu Edgy and Firefox 2.0.0.1. It has crash recovery. It even preserves the text which you’ve typed in text areas. I guess it would have, too, had it decided to come up. Instead, each tab which was opened prior to the crash just sat and spun until each of them appeared to totally freeze and I became too impatient to wait any longer.

I figured Firefox had to keep that session information somewhere, so I began rummaging through my Firefox session folder (~/.mozilla/firefox/{{random text string}} on Ubuntu). Two files which showed promise were sessionstore.bak and sessionstore.js. I opened the .bak file and looked for some text that I had been typing in and to my (almost) surprise, I found it.

I saved off the section that I was interested in to its own file. It had been reformatted slightly. All the spaces were %20. The urllib module in the Python standard library has an “unquote” function, so a little ` urllib.unquote(open(”/tmp/blogpost.txt”, “r”).read())` at an IPython prompt fixed my text right up.