javascript - how to initialize fullscreen without user interaction -
hi i'm beginner , want create web-app , needs in fullscreen when page load... without user interaction
i have @ click function works correctly... want load function @ start page
addeventlistener("click", function() { var el = document.documentelement , rfs = el.requestfullscreen || el.webkitrequestfullscreen || el.mozrequestfullscreen ; rfs.call(el); }); someone me :)
thank you!
that not possible.
i ran following snippet in browser console:
var e = document.getelementbyid('answers'); (e.webkitrequestfullscreen || e.mozrequestfullscreen).apply(e); chrome told me:
failed execute 'requestfullscreen' on 'element': api can initiated user gesture.
firefox told me:
request full-screen denied because element.mozrequestfullscreen() not called inside short running user-generated event handler.
that restriction put in place prevent abuse, similar on window.open (see this or this question example).
Comments
Post a Comment