Element: fullscreenerror イベント

Limited availability

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

fullscreenerror イベントは、ブラウザーが全画面モードに切り替えることができなかったときに発生します。

fullscreenchange イベント イベントと同様に、2 つの fullscreenerror イベントが発生します。1 つ目はモード切替に失敗した Element に送られ、2 つ目はその要素を含む Document に送られます。

全画面モードへの切り替えが失敗する理由の一部は、 Fullscreen API のガイドをお読みください。

このイベントはキャンセルできません。

構文

このイベント名を addEventListener() などのメソッドで使用するか、イベントハンドラープロパティを設定するかしてください。

js
addEventListener("fullscreenchange", (event) => {});

onfullscreenchange = (event) => {};

イベント型

一般的な Event です。

js
const requestor = document.querySelector("div");

function handleError(event) {
  console.error("an error occurred changing into fullscreen");
  console.log(event);
}

requestor.addEventListener("fullscreenerror", handleError);
// or
requestor.onfullscreenerror = handleError;

requestor.requestFullscreen();

仕様書

Specification
Fullscreen API
# handler-document-onfullscreenerror

ブラウザーの互換性

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
fullscreenerror event

Legend

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

Full support
Full support
Partial support
Partial support
No support
No support
Requires a vendor prefix or different name for use.
Has more compatibility info.

関連情報