Godot Version
Godot 4.3 Stable
Question
When I use the Remote debug - Run in browser button to run my Godot 4.3 in the browser (Chrome), it doesn’t do anything.
With any other tab, it works and the web goes fullscreen. But not with my game running. I’ve searched but I can’t find any solution that works.
This is the last I’ve tried:
func _input(event):
if event is InputEventKey and event.pressed:
if event.scancode == KEY_F11:
toggle_fullscreen()
func toggle_fullscreen():
if Engine.has_singleton("JavaScriptBridge"):
var js_bridge = Engine.get_singleton("JavaScriptBridge")
# Revisar si ya está en pantalla completa
var is_fullscreen = js_bridge.call("eval", "document.fullscreenElement != null")
# Alternar pantalla completa
if is_fullscreen:
js_bridge.call("eval", "document.exitFullscreen();")
else:
js_bridge.call("eval", "document.documentElement.requestFullscreen();")