The HTTP Feature-Policy
header fullscreen
directive controls whether the current document is allowed to use Element.requestFullscreen()
. When this policy is enabled, the returned Promise
rejects with a TypeError
.
By default, top-level documents and their same-origin child frames can request and enter fullscreen mode. This directive allows or prevents cross-origin frames from using fullscreen mode. This includes same-origin frames.
Note: If both this directive (i.e. via the allow
attribute) and the allowfullscreen
attribute are present on an <iframe>
element, this directive takes precedence. There was a bug whereby the fullscreen
directive didn't work unless the allowfullscreen
attribute was also present, but this has been fixed as of Firefox 80 (bug 1608358).