Open forresto opened 11 years ago
I've been working on a patch for this. It would use window.onbeforeunload
which triggers a native alert
giving the user the option to stop the back/forward action that might have been accidentally triggered.
The problem I'm having is that the event isn't triggered if all that changes in the location bar is the hash. You have to navigate to another page/domain etc. But in the case of this app changing the hash might send you away from your app and lose progress. I'm not sure if you can get around this limitation.
How about auto-saves ?
Autosaves can be annoying. onbeforeunload
is a good direction I think. http://backbonejs.org/#Router router.on("route", function() {});
might help to listen for internal hash changes.
Note: I'm currently hacking up iframework.js to try to make it more modular and easier to maintain.
Chrome has a new two-finger scroll to navigate history, which annoyingly erased some unsaved work.
thoughts:
Warnings are kinda lame, and an autosave that reloads your last state might be less annoying, but that doesn't help if you have been working on an image or animation...