Jump to content

rayo
 Share

Recommended Posts

hi every one!.
trying to finish my first phaser game i have this problem:
 
I want the game at fullscreen from the beginning, but only if is a user action, chrome, firefox and Explorer allow this...
 
messaje from browsers:
//Chrome:   Failed to execute 'requestFullScreen' on 'Element': API can only be initiated by a user gesture.
//Firefox:  Phaser.ScaleManager: requestFullscreen failed or device does not support the Fullscreen API
//Explorer: Phaser.ScaleManager: requestFullscreen failed or device does not support the Fullscreen API
 
can  i dispatch  a mouse click event , like in AS3 (simulate a user click)...
how can i do that?
is there another solution to have fullscreen without a user "clicking"?
 
thanks!!

 

Link to comment
Share on other sites

You're essentially trying to bypass the browser's security. That's a black art, and there may be a way to hack these browsers, but probably not from a website. You can disable the game unless it's in a full-screen state, and you can trigger DOM events, but (fortunately for the security of mankind) you cannot trigger an event on the browser application from a web-app.

Link to comment
Share on other sites

Imagine a web-site that forced your computer into a full-screen state, and never let you get out of full-screen. I mean, it's not the end of the world, but it's a problem browser venders foresaw when they decided to make users click a button before allowing full-screen. If it were possible to spoof events on and collect data from the browser application itself, web-sites would be able to spy on your history, perhaps get your saved passwords, set any site to the homepage, etc. 

 

Security may be a hassle to web devs sometimes, but I'm sure happy web browsers are trying to be secure.. And are actually agreeing on something for once.

Link to comment
Share on other sites

I agree to be careful with people data .But in the case of full Screen too?, ok, i put a button in the midle of my game, you cant play if you dont press this button, so,go to fullScreen, how can browsers have the security there is a way to go out of fullscreen?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...