(kind of OT) Equivalent to onunload or onbeforeunload in Saf

I realize this isn’t specifically a Rails question, but I figure others
here will have encountered it. I have a client that wants form data to
be saved when leaving a page. This could include leaving a page by
following a link, closing a window, or pressing the back or forwards
buttons. So … I do some research, and found this Web page:

which describes using onbeforeunload to show a confirmation (I’m doing a
form submit, so it seems like onunload would work, too). This works in
Firefox and IE. Safari, however, blithely ignores this.

I know a lot of Rails developers are Mac users so I was hoping someone
knows of a solution to this issue?

FYI, I tried Safari 2.02 on Tiger.

Thanks!

Jen