我们的志愿者还没有将这篇文章翻译为 中文 (简体)加入我们帮助完成翻译
您也可以阅读此文章的English (US)版。

This Boolean attribute controls the device's screen. Setting it to false will turn off the screen.

Syntax

screenEnabled = window.screen.mozEnabled

Specification

Not part of specification.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic support
DeprecatedNon-standard
Chrome No support NoEdge No support NoFirefox Full support 12
Disabled
Full support 12
Disabled
Disabled From version 12: this feature is behind the dom.screenEnabledProperty.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile No support NoFirefox Android Full support 14
Disabled
Full support 14
Disabled
Disabled From version 14: this feature is behind the dom.screenEnabledProperty.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No

Legend

Full support  
Full support
No support  
No support
Non-standard. Expect poor cross-browser support.
Non-standard. Expect poor cross-browser support.
Deprecated. Not for use in new websites.
Deprecated. Not for use in new websites.
User must explicitly enable this feature.
User must explicitly enable this feature.

文档标签和贡献者

此页面的贡献者: fscholz, teoli, jsx, kscarfone, Sheppy
最后编辑者: fscholz,