ShadowRoot:fullscreenElement 属性

Limited availability

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

ShadowRoot 接口的 fullscreenElement 只读属性返回影子树中当前全屏显示的元素。

当前以全屏模式显示的 Element,若无全屏元素则为 null

示例

js
let customElem = document.querySelector("my-shadow-dom-element");
let shadow = customElem.shadowRoot;
let fullscreenElem = shadow.fullscreenElement;

规范

Specification
Fullscreen API
# ref-for-dom-document-fullscreenelement②

浏览器兼容性

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
fullscreenElement

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.

参见