webkitRequestFullScreen fails when passing Element.ALLOW_KEYBOARD_INPUT in Safari 5.1.2
fullscreen, javascript, safari
Solution
This is known Safari bug. It can be sniffed during full screen switching:
someElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
if (!document.webkitCurrentFullScreenElement) {
// Element.ALLOW_KEYBOARD_INPUT does not work, document is not in full screen mode
}
Use this real time sniffing and thus your code will support future fixing bug in Safari.
Problem
Running into the following problem specifically in Safari 5.1.2 when attempting to use the javascript fullscreen api. By copy and pasting the following lines into your browser on a loaded page, you can see the effect. This works in Chrome 15 and Safari 5.1.2: ``` javascript:document.querySelector('body').webkitRequestFullScreen(); ``` This works in Chrome 15 but fails silently in Safari 5.1.2: ``` javascript:document.querySelector('body').webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT); ``` ALLOW_KEYBOARD_INPUT seems like it should work in Safari, according to documentation here: http://developer.apple.com/library/safari/#documentation/WebKit/Reference/ElementClassRef/Element/Element.html Any ideas why this isn't working?