0
votes

This is source code for exit from fullscreen mode:

var cancelFullScreen = document.webkitCancelFullScreen || document.mozCancelFullScreen;
cancelFullScreen.call(document);

it's works correctly when i enter fullscreen using function startFullScreen, but don't work after pressing F11 key - browser won't exit fullscreen mode. Browsers Chrome 18 and Firefox 12. Why it's happens? Is it bug, security restriction or some other? Is it possible to fix it?

2

2 Answers

1
votes

F11 and requestFullScreen are the different things in browsers. requestFullScreen requires permissions from users while pressing F11 is not.

Also as you may see they have different interface. For example opening window in fullscreen mode (using JS) in Google Chrome don't tell user that he can go out pressing F11 while native fullscreen do.

0
votes

Your example makes no sense, because you can only request full screen on an element, not on a document. The API also requires you to cancel full screen on the element on which you requested full screen. The Gecko API also tells you the element that it thinks is in full screen mode, i.e. the one that you need to cancel full screen on. If you press F11 to enter full screen, this element remains null, because you cannot cancel it.