Any way to prevent user from closing tab (or showing a warning before they close it) from within Forms?

Thanks mnikitina, I've incorporated a similar method which also triggers a logic app to do necessary cleanup, as was finding it impossible to run any update code within the 'beforeunload' function.

Regards
Andy