How can I quit a Unity WebGl build before it finishes loading?

Hello friends,

I can call unityInstance.Quit(), but only when the game finishes loading.

If I try to call unityInstance.Quit() before the game finishes loading an exception is thrown and Unity never quits. The exception is an undefined exception with unityInstance.Quit().

I want players to be able to back out of a game at any time. Maybe they changed their mind about playing the game, and want to select a different game on the website.

Thanks for helping.