I'm trying the code from here to start fullscreen mode. It works if executed onclick
, but not onload
. (I've also discovered that setting an alert
before it will disable it unless the alert
is clicked immediately.) So perhaps the problem is that sometimes the browser isn’t 'ready' for fullscreen.
So what is the last event fired when a page is pletely ready? Or is the solution different?
I'm trying the code from here to start fullscreen mode. It works if executed onclick
, but not onload
. (I've also discovered that setting an alert
before it will disable it unless the alert
is clicked immediately.) So perhaps the problem is that sometimes the browser isn’t 'ready' for fullscreen.
So what is the last event fired when a page is pletely ready? Or is the solution different?
Share Improve this question asked Jan 9, 2013 at 18:53 ispiroispiro 27.7k40 gold badges160 silver badges318 bronze badges3 Answers
Reset to default 17Fullscreen requires user interaction to initiate. It's a security feature.
Imagine if some pop-up could force you into fullscreen mode, lock your mouse pointer, and start playing an advertisement without your permission.
Having a 'enable full screen' link or button who's visibility is toggled in the document 'fullscreenchange' event handler seems like a practical approach.
well this might help Fullscreen script
But I agree with LastCoder
Fullscreen requires user interaction to initiate. It's a security feature.
Imagine if some pop-up could force you into fullscreen mode, lock your mouse pointer, and start playing an advertisement without your permission.
Was trying to do this myself then I came to this site Fullscreen API Phishing Attacks
Basically, if fullscreen mode was allowed onload, we don't know if site is actual website...fake site can have the lock logo saying it's safe, etc.