From 2b3d4533c4a27743e95d19a0ac964f9255d4a4ed Mon Sep 17 00:00:00 2001 From: Leroy Hopson Date: Fri, 26 Aug 2022 22:32:45 +1200 Subject: [PATCH] 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. --- examples/menu/menu.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/menu/menu.gd b/examples/menu/menu.gd index 51ef5c8..33d9535 100644 --- a/examples/menu/menu.gd +++ b/examples/menu/menu.gd @@ -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()