CKTIS / HTML
allowfullscreen — fullscreen permission in a frame
The boolean attribute `allowfullscreen` delegates fullscreen capability to an `iframe`; it does not enter fullscreen by itself.
Version: HTML Living Standard
Syntax
<iframe src="/video" allowfullscreen></iframe>Write bare allowfullscreen or allowfullscreen="". Presence means true: allowfullscreen="false" is a nonconforming attempt to disable it and still makes allowFullscreen true. Remove the attribute to remove this declaration.
This is an older form of Permissions Policy delegation. A fullscreen restriction in allow takes precedence, and the frame cannot bypass a prohibition in its ancestor document. Permission does not replace a Fullscreen API call, required user activation, or handling a rejected request.
The example deliberately includes the incorrect "false" spelling to show the boolean-attribute trap. Meanwhile allow="fullscreen 'none'" denies the feature: the reflected attribute is true, but fullscreenEnabled inside the frame is false. The test does not enter fullscreen.
Examples
<!doctype html><meta charset="utf-8">
<iframe id="frame" title="Local player" allowfullscreen="false"
allow="fullscreen 'none'" srcdoc="<p>Player</p>"></iframe>
<output id="result"></output>
<script>
document.querySelector('#frame').addEventListener('load', event => {
const frame = event.target;
document.querySelector('#result').textContent =
'attributePresent=' + frame.allowFullscreen +
'; effective=' + frame.contentDocument.fullscreenEnabled;
});
</script>Result
attributePresent=true; effective=false
The test distinguishes attribute presence from effective policy. For ordinary use, choose the conforming syntax above.