Document: fullscreen プロパティ

非推奨;: この機能は非推奨になりました。まだ対応しているブラウザーがあるかもしれませんが、すでに関連するウェブ標準から削除されているか、削除の手続き中であるか、互換性のためだけに残されている可能性があります。使用を避け、できれば既存のコードは更新してください。このページの下部にある互換性一覧表を見て判断してください。この機能は突然動作しなくなる可能性があることに注意してください。

廃止された Document インターフェイスの fullscreen プロパティは読み取り専用で、文書が現在全画面モードで表示されているかどうかを報告します。

このプロパティは読み取り専用ですが、変更されても(厳格モードでも)例外を投げません。セッターは何もしないので、無視されます。

メモ: このプロパティは非推奨であり、文書が全画面モードになっているかどうかは、 Document.fullscreenElementnull ではないことで確認することができます。

返値

真偽値であり、文書が全画面モードで表示されているときに true、それ以外の場合に false になります。

このシンプルな関数は、現在全画面モードがアクティブになっているかどうかを、廃止された fullscreen プロパティを使用して報告しています。

js
function isDocumentInFullScreenMode() {
  return document.fullscreen;
}

一方、次の例では、現在の fullscreenElement プロパティを使用して同じことを確認しています。

js
function isDocumentInFullScreenMode() {
  return document.fullscreenElement !== null;
}

fullscreenElementnull でなければ、これは true を返し、全画面モードで表示されていることを示します。

仕様書

Specification
Fullscreen API
# dom-document-fullscreen

ブラウザーの互換性

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
fullscreen
Deprecated

Legend

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

Full support
Full support
Partial support
Partial support
No support
No support
Deprecated. Not for use in new websites.
Uses a non-standard name.
Has more compatibility info.

関連情報