Tweaking the window.onbeforeunload handler for editing config files.