Is possible automatic fullscreen with html5?

2019-04-26 21:44发布

问题:

I'm based on Using the Fullscreen API in web browsers (http://hacks.mozilla.org/2012/01/using-the-fullscreen-api-in-web-browsers ) for fullscreen , but only works with a click event or with console firebug, not with submit event or mouseover or similar for made automatic. Is possible automatic fullscreen with html5 without click event or similar ?

Edit: I understand the security and accessibility reasons if not possible, but in some environments this can be hopeful.

回答1:

No, it's not possible - for security reasons accessing full screen requires the user's "permission", and so is tied to browser input events.



回答2:

No, that is not possible. The requestFullScreen() must be triggered by a direct user action (like a click) for security considerations. It's just the same as with popups.

Read https://wiki.mozilla.org/Security/Reviews/Firefox10/CodeEditor/FullScreenAPI and maybe https://wiki.mozilla.org/Gecko:FullScreenAPI for reference.