Bug 121496

Summary: webkitRequestFullScreen with ALLOW_KEYBOARD_INPUT does not allow inputs
Product: WebKit Reporter: Allan Jardine <allan.jardine>
Component: WebKit Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED WONTFIX    
Severity: Normal CC: ap, chrisjshull, jer.noble, jonlaliberte, jonlee, jradosz+webkit, sam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
URL: http://sprymedia.co.uk/media/misc/webkit/fullscreen-input.html
Attachments:
Description Flags
Page showing the inability to go full screen with ALLOW_KEYBOARD_INPUT none

Description Allan Jardine 2013-09-17 09:01:02 PDT
Created attachment 211913 [details]
Page showing the inability to go full screen with ALLOW_KEYBOARD_INPUT

The documentation for webkitRequestFullScreen on the Apple web-site says that we should be able to pass in Element.ALLOW_KEYBOARD_INPUT into webkitRequestFullScreen to allow keyboard input when fullscreen. This is not the case - we don't even get as far as trying to enter text in full screen, we simply don't go full screen at all.
Comment 1 Jer Noble 2013-09-18 10:04:33 PDT
This is intentional; the ability to accept alphanumeric keyboard events in full screen mode is considered a security risk, and the Apple port has disabled this feature.  The Safari developer documentation is (unfortunately) out-of-date.

Additionally, the most recent draft of the Fullscreen API spec <https://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html> has removed the `flags` parameter from Element.requestFullScreen().
Comment 2 Allan Jardine 2013-09-18 14:03:53 PDT
Thanks for the feedback!

Is there any way to know that an input has been blocked? An event being fired in Javascript perhaps? At the moment, users of my application (video based, so it leads itself to full screening) will simply here a system alert and see there input not being entered. An event would at least let me tell them that Safari is blocking the input.
Comment 3 Jer Noble 2013-09-18 14:49:46 PDT
(In reply to comment #2)
> Thanks for the feedback!
> 
> Is there any way to know that an input has been blocked? An event being fired in Javascript perhaps? At the moment, users of my application (video based, so it leads itself to full screening) will simply here a system alert and see there input not being entered. An event would at least let me tell them that Safari is blocking the input.

No, there isn't an error message generated. (A clever attacker could use those error events; we just eat them silently instead.)
Comment 4 Jon 2016-06-14 17:41:04 PDT
 > No, there isn't an error message generated. (A clever attacker could use
> those error events; we just eat them silently instead.)

Wouldn't it be better to ask the user for permission to go full screen, and allow text input after that?

As is, it really limits the web apps you're able to build without being able to use text input.

I also tried using the js prompt function to request data while full screen. That did not end well at all in Safari.

You can see here: http://www.jonathanlaliberte.com/fullscreentest.html

It works well in Firefox and Chrome, but in Safari it seems to lock up the current tab.