Change exit action for HTML5

Previously HTML5 exports would reload the page on exit. This commit
changes the behaviour to go back to the previous page (if any) or close
the tab and/or window if there is no previous page.
This commit is contained in:
Leroy Hopson 2022-08-26 22:32:45 +12:00
parent 77a3b1a385
commit b97c7116a7
No known key found for this signature in database
GPG key ID: D2747312A6DB51AA

View file

@ -161,7 +161,7 @@ func _on_Terminal_key_pressed(data: String, event: InputEventKey) -> void:
scene.queue_free()
"Exit":
if OS.has_feature("JavaScript"):
JavaScript.eval("window.location.reload()")
JavaScript.eval("window.history.back() || window.close()")
get_tree().quit()