Exiting the game on a web version

Godot Version

4.6.1

Question

Hello. Using get_tree().quit() will simply freeze the game. Is there any way to make it close the tab instead? Thanks.

You could try to use the JavaScriptBridge to call window.close()

2 Likes

Thank you. That was really simple. I used this:

JavaScriptBridge.eval("window.close()")