UPDATE: In WordPress 2.1, there’s a Autosave feature that will saved the draft of the post or page in x second.
It isn’t Firefox or Flock if it doesn’t crash. There is nothing more frustrating than watching it happens while you’re writing for your next entry. Thankfully, it never happens to me yet. If you use GMail, there’s a feature called “Auto-Save” which is designed to save messages that you are writing automatically in-case of a browser crash. WordPress should have this kind of features built in to the core since the majority of its users are obviously Firefox/Flock user.
Disclaimer: This is a grade F script of all JavaScript that ever exist in the InterWeb. So, use it at your own risk.
Introducing your savior, Save It!
As far as I know, other than saving your entry to a database, another thing that’s known to be bulletproof for this kind of problem is using your browser cookies.
Basically when you start typing in the WordPress Admin Write Post textarea, the script logged your keystroke according to a function that triggered the onKeyUp event handler and then save it to your browser cookie. If the cookie name exists it will attempt to override and update the value.
When your browser suddenly crash, return to the page and hopefully it will load the previous saved value. Currently it only saves the textarea field since that’s the only important thing that’s matter IMHO.
Show me the script
Like any other WordPress Plugin, just upload the file and activate. Take note that the script doesn’t work with TinyMCE visual editor.
Download Save It!
If you happen to be blogging on more than 1 blog, you have to set a unique cookie name to avoid data redundancy. To do this open save_it.js and change autosave_post cookie name to something else. If you want to use MD5 like WordPress does to it cookies, you can use JavaScript MD5.
It doesn’t stop there
You can do a lot of neat stuff rather than a basic script if you’re using Prototype. You can even imitate it much like GMail “Auto-Save” feature. But that’s another story to tell.
Have fun!