I know this question is very old, and I’m not sure if this solution works on that date or wasn’t implemented in the engine yet, but I figured that I would share my solution in case it help those coming across this question.
I created a new function in the jslib called Initialize that I call within a monobehaviour. (See the same documentation for how to call the functions) I then handled the close window event. You can adjust this to how you like even setting a way to make the application “Dirty” and only showing the message when the user has changed something. Here is the function I made:
Initialize: function() {
window.onbeforeunload = function() {
return "Are you sure you really want to leave the application?";
};
},
I know that the javascript code block isn’t for this, but I used it anyway.
Hopefully this helps the next person who is getting super annoyed with the webGL stuff.