UserActivation.isActive
Baseline 2023Newly 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 GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
isActive |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
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.