Can use beforeunload event to detect leaving the page with unsaved changes. Unfortunately this is kind of tricky and to do it properly will probably require switching away from the window.location.hash-based navigation method.
Low priority for now because Pastedown isn't intended to be used for composition (it's for pasting!).