Regarding Draft autosave feature.
There is draft auto-save feature, Cool addition!
- How often does this save happen?
- How does this work?
Saves draft every 30 seconds on on page unload, so you don't lose whatever you've typed.
For doing this on page leave there is a trick, "ajax" request must be sent synchronously - as browsers don't allow to fully hijack the page unload event - and the event to run it on is "onbeforeunload".
DraftAnswer that subclass
To enter a block of code: