Approaches to, not incremental saves, but finding time for a full save:
- onunload
onunload, as previously mentioned. I have found this to be reliable (but using localStoragelocalStorage, not network, which may change things). - Save when your window loses focus.
- Save periodically on a timer, adjusted to: when the last save has not been in n minutes and the user has not made any input recentlyin m seconds.