Add onbeforeunload handler to source editor.