I saw a different tuto for do fullscreen with "browser" function such as "request fullscreen" or "cancel fullscreen".
It is possible to work's with a html5 website open with chrome or mozilla?
Both chrome and firefox should support the request fullscreen (and cancel fullscreen) action, and if you are affraid it won't work in a browser, I think there is a condition that tests if that specific feature is supported (so if it is not supported, you don't display said option as availiable).
It's ok, i use the condition if browser is Fullscreen and invert is fullscreen. Before i use the conditions with a global variable and it's doesn't works. Now, I use when my sprite is clicked.
Thanks for your answer Aphrodite.
Develop games in your browser. Powerful, performant & highly capable.
Indeed I forgot to tell that, If I am correct, this action must be the result of a user interaction to work (on object clicked or on key pressed, etc..), I think this is by design in the browsers to prevent websites to force fullscreen on users.