[whatwg] Full Screen API Feedback
jer.noble at apple.com
Thu May 12 01:12:09 PDT 2011
On May 12, 2011, at 12:54 AM, Jer Noble wrote:
> Surely there's a way to achieve the security benefits you're hoping for without requiring intentionally obtuse API?
Okay, here's another proposal that should work with Firefox's passive permission system:
- Add a new boolean Element property "canRequestFullScreen". This would map to Firefox's "Never" permission choice.
- Add the "fullscreendenied" event. This would map to Firefox's "Not now" permission choice.
A video player would first query canRequestFullScreen to decide whether to display the full screen button in its UI. If the user hadn't previously decided to never allow this site to enter full screen, this property would return true (or perhaps "maybe"). Upon clicking the full screen button, the user would be presented with a notification. If the user chooses "Never", a "fullscreendenied" event is dispatched at the requesting element, and subsequent calls to canRequestFullScreen would return false (or perhaps an empty string). In this situation, the video player would hide their full-screen button. If the user chooses "Not now", a "fullscreendenied" event is dispatched at the requesting element, but subsequent calls to canRequestFullScreen would still return true/"maybe".
The "canRequestFullScreen" property could be replaced with a function which takes the same flags as requestFullScreen.
More information about the whatwg