onbeforeunload is typically implemented to ask user to take some actions before leaving the website. But somehow it does not work as intended as before, not sure since when, but it does not work in the latest Google Chrome browser.

  1. Custom Alert Message The message can no longer be customised. Even though you have specified the message, it will still display to you Changes that you made may not be saved.