Not sure how useful this is, but it might be interesting to have an action to set a window.onbeforeunload callback. This can be handy to set from the server-side when you are sending down some data which is not persisted yet. And with this you would get a warning when you attempt to close the window/tab. Like:

The example above can be achieved with this snippet:
window.onbeforeunload = function() {
return true;
}
Obviously we would also need an action to clear the event-listener again.
Not sure how useful this is, but it might be interesting to have an action to set a
window.onbeforeunloadcallback. This can be handy to set from the server-side when you are sending down some data which is not persisted yet. And with this you would get a warning when you attempt to close the window/tab. Like:The example above can be achieved with this snippet:
Obviously we would also need an action to clear the event-listener again.