You can't prevent "go back", "refresh", "realod", "close", ... totally (see answer of zilav).   But you can show a warning, which the user must confirm:   Put this code in UniMainForm.script: onbeforeunload = function() { return "This will close the web app! Are you sure?"; };