3

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 completely ready? Or is the solution different?

3 Answers 3

17

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.

Having a 'enable full screen' link or button who's visibility is toggled in the document 'fullscreenchange' event handler seems like a practical approach.

Sign up to request clarification or add additional context in comments.

Comments

0

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.

1 Comment

museum alert. the script isn't working in newer browsers.
0

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.