Your laptop is broken. Apple doesnt like cooling, and cooks discrete GPUs by default. Throttling starts at some ridiculous temperature like 80 or 100 C! This is why they were twice now forced to do massive recalls due to bad GPUs.
Strange, I've developed it on my Macbook pro mostly and I never had such issues. I've used google-chrome.
Probably a WebGL-Issue and not much you can do about it ...
I have 2017 MBP with touch bar. The sound kept playing, but mouse and keyboard didn't respond to anything. The game canvas was black. Couldn't quit browser or switch window from keyboard so only option was to force boot.