Document: fullscreenerror イベント
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
fullscreenerror
イベントは、ブラウザーが全画面モードに移行できないときに発生します。
fullscreenchange
イベント イベントと同様、二つの fullscreenerror
イベントが発行されます。 1 つ目はモード切替に失敗した Element
へ送られ、 2 つ目はその要素を所有する Document
へ送られます。
全画面モードへの切り替えに失敗する理由については、全画面 API のガイドを参照してください。
このイベントはキャンセルできません。
構文
このイベント名を addEventListener()
などのメソッドで使用するか、イベントハンドラープロパティを設定するかしてください。
js
addEventListener("fullscreenerror", (event) => {});
onfullscreenerror = (event) => {};
イベント型
一般的な Event
です。
例
js
const requestor = document.querySelector("div");
function handleError(event) {
console.error("全画面モードへの移行時にエラーが発生しました");
console.log(event);
}
document.addEventListener("fullscreenerror", handleError);
// or
document.onfullscreenerror = handleError;
requestor.requestFullscreen();
仕様書
Specification |
---|
Fullscreen API # handler-document-onfullscreenerror |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
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.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.