Closing browser tab html5

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By heavyathan

Hi, all.
I’ve developed an small game for a ONG and we want to host in its web.
All works quite Ok but closing the browser tab when exiting the game. Also I was not able to start the game in fullscreen, but this is another war.

Honestly, we have no idea about webs, html neither java, so we got the godot exported files and put in a subdomain, to directly serving the game.

I use JavaScript.eval("window.close()")q, but it only freezes the game, don’t close the tab.

I’ve started a local server with python and the behaviour confuse me a lot:

  • If I run from the HTML icon in the editor, works perfectly and close the tab.
  • If I export to html5 and put the files in the server main directory and type localhost in Firefox, exiting the game doesn’t work.

Here you have the temporal game link (Sorry the language, the ONG and myself are from Spain. Last button, “Salir”, means quit):
http://noa.sindrome5p.org/

So, should we change something in Godot, or the exported files to have the correct behaviour?

Thanks in advance.

:bust_in_silhouette: Reply From: trisolaran

I wrote something about my experience with html-export here:
I switched from the “eval” system to the new godot-js bridge, there are more possibilites, find a nice introduction here.