code: function addUnloadHook () {
    window.onbeforeunload = function (e) {
      var msg = "Are you sure? Any unsaved progress will be lost."
      e = e || window.event;
  
      // For IE and Firefox prior to version 4
      if (e) {
        e.returnValue = msg;
      }
  
      // For Safari
      return msg;
    };
  }
docs: Adds a confirmation dialog when the user navigates away from the app.