On Mon, Apr 29, 2013 at 11:24 AM, <[email protected]> wrote: > Hello Everyone, > > I am new to this forum, but it seems like the right place to ask this > question. In the utility code I'm writing, I'd like to be notified that my > app is about to quit and then ask the system for some time while I dump my > cache into the database (through IndexedDB). > > I see that there is the onunload event, but my understanding is that if I > cancel that event, a dialog pops up. This is highly undesirable as I'd rather > just postpone quitting (or show my own gui) until my operation is finished. > > Are there apis that would allow me to do this? Any suggestions?
Generally speaking it's better to dump the data to IndexedDB on a regular basis rather than trying to do it right before the application is closed. Many times we close applications based on running low on memory and we simply don't have the ability to let the app take any actions whatsoever since we're so low on memory. Additionally, saving data on a regular basis means that less data will be lost if the app happens to crash for other reasons. / Jonas _______________________________________________ dev-webapps mailing list [email protected] https://lists.mozilla.org/listinfo/dev-webapps
