Full-screen on Android Browser (Brave/Chrome)

Godot Version

4.5.1

Question

I am trying to make a web export for a played by 2 players holding opposite ends of a mobile phone, but the browser address bar is taking up too much space and I can’t get it to go into fullscreen mode.

Is there a way to achieve true full-screen on android browsers without the address bar showing?
I tried setting Display in Export Settings to Fullscreen and Standalone (with Progressive Web App enabled), but the address bar is always there.

The best way to achieve this is to edit the html export shell in your project to invoke a request for full screen mode via javascript when the game is launched.

[tl;dr]

You can try and see if this custom export.html shell works for you: source on codeberg

Used for this webgame of mine: https://play-jacques.codeberg.page/

[/tl;dr]

The official godot docs tell you how to use a custom html shell in your export in your project.

For the html I shared here I started out with the html export shell that godot engine ships itself.

In order for all browsers to allow you to go fullscreen, you need to at least have the user press a button, or something similar (this is also true for using audio, by the way):

This is referred to as transient user activation.

That is why my html-shell shows a button to click.

Alternatively you can add a “go fullscreen” button inside your game which will also be seen as a transient user activation by the web browser.

I edited my initial answer to something that should definitely work for you.

Thank you very much for the answer! I tried exporting using your export.html template by setting Options -> Custom Template -> Debug, Release, but am getting the error on the right:

I have tried this on 4.5.1 and 4.6.2 with the same results. Do you have any idea what might be wrong?

Could it be due to an issue with the CSS? Or is there something in the code that is specific to your project that cannot run because it cannot find it in my project?

Thank you again!

Hi!

I think I see your issue. You need to adapt the ‘Custom HTML Shell’ field to my html, not the “Custom Template” fields:

I will improve my answer.

Oh my god, I feel so silly for missing that! Thank you so much!

I will take some time to understand the bits necessary for full screen (fullsize--true).
This issue had been annoying me for months, so thank you again Ren!

Well, I did put you on the wrong foot for a minute there by mixing up the words “shell” and “template”..:smiling_face:

@ARRAYEWHY_Lee : maybe we could check this plugin out as well. Just ran into it on the Godot discord server: