UserActivation.isActive

Baseline 2023
Newly available

Since November 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

Experimental: これは実験的な機能です。
本番で使用する前にブラウザー互換性一覧表をチェックしてください。

UserActivation インターフェイスの読み取り専用プロパティ isActive は、現在のウインドウでユーザーによる一時的な有効化がされているかを表します。(一時的な有効化を参照してください)

boolean です。

最近ユーザーによる操作が行われたかをチェックする

ユーザーが最近ページを操作したかをチェックするために isActive プロパティを使用します。

js
if (navigator.userActivation.isActive) {
  // 例えば、メディアの再生の要求に進む
}

仕様書

Specification
HTML
# dom-useractivation-isactive

ブラウザーの互換性

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
isActive

Legend

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

Full support
Full support

関連情報