Question about EnterFullScreen - Forum

Forum Navigation
You need to log in to create posts and topics.

Question about EnterFullScreen

I wanted to start the application in full screen, so I used EnterFullScreen in the startup event but it doesn't work. The console sends the following messages.

La requête d’accès au plein écran a été refusée, car Element.requestFullScreen() n’a pas été appelée à l’intérieur d’un gestionnaire d’évènement généré par l’utilisateur. main.js:3:26327
Uncaught (in promise) TypeError: Fullscreen request denied
d http://localhost/js/main.js:3
EnterFullScreen http://localhost/js/main.js:3
Joueurs_pageenter http://localhost/js/main.js:3
Angular 5
<anonymous> http://localhost/js/main.js:1
Angular 10
jQuery 13

Of course if I call EnterFullScreen inside a pushbutton it works.

My question is simple, is it forbidden to start an application in full screen ?

My question is simple, is it forbidden to start an application in full screen ?

@phil78 yes, it's. For security and user experience reasons some JavaScript commands can only be executed after a user action like pressing a button. In any other situation you will get a "Fullscreen request denied" error.

Regards

Thank you Luis.

Regards