system
May 21, 2020, 11:22pm
1
Attention
Topic was automatically imported from the old Question2Answer platform.
Asked By
Charlie
Here’s our functioning web app for context: https://ivoyager.dev/planetarium .
Well, we can ask to open a new browser window with OS.shell_open()
. But I can’t find a way for our HTML5 web app to close its own window on quitting. SceneTree.quit() just freezes the sim, leaving window open on a non-functional app.
Appreciate any help you have for me!
system
May 21, 2020, 11:36pm
2
Reply From:
RazorSh4rk
JavaScript.eval("window.close()")
should work.
docs
It works! Thanks!
I did need a test to avoid doing that in non-HTML5 build (otherwise it locks up the cmd line for some reason):
if OS.has_feature('JavaScript'):
JavaScript.eval("window.close()")
Charlie | 2020-05-22 01:03
You’re welcome I really like this project btw
RazorSh4rk | 2020-05-22 10:01
Thank you for the project compliment! I’d really like to see other developers get involved!
Charlie | 2020-05-23 01:00