HTMLIFrameElement:allowFullscreen 属性

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

HTMLIFrameElement 接口的 allowFullscreen 属性是一个反映了 <iframe> 元素的 allowfullscreen 属性的布尔值,它表示 iframe 的内容是否允许使用 requestFullscreen()

备注: 此属性被视为遗留属性。请改用 allow="fullscreen"HTMLIFrameElement.allow

一个布尔值。

示例

html
<iframe id="el" allowfullscreen></iframe>
js
const el = document.getElementById("el");
console.log(el.allowFullscreen); // 输出:true

规范

Specification
HTML
# dom-iframe-allowfullscreen

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
allowFullscreen

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support
Uses a non-standard name.
Has more compatibility info.

参见