Add beforeunload warning.