F11 for browsers fullscreen doesn't work in my web game

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();")
1 Like

Another very annoying problem I’m running into is that it disables the Web Developer tools shortcut (F12 or Ctrl Shift I), which means every time you do a remote debug in the browser you have to traverse the menus in that browser and find Web Developer Tools and click it.