To comply with HTML standard, there are two new changes on how the cancel dialog gets prompted for beforeunload event. 1. If event.preventDefault() is called, prompt cancel dialog. 2. If event.returnValue is the empty string, do not prompt cancel dialog.