UserActivation.hasBeenActive
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
インターフェイスの読み取り専用プロパティ hasBeenActive
は、現在のウインドウでユーザーによる粘着的な有効化がされているかを表します。(粘着的な有効化を参照してください)
値
boolean
です。
例
これまでにユーザーによる操作が行われたかをチェックする
ユーザーがこれまでにページを操作したかをチェックするために hasBeenActive
を使用します。
js
if (navigator.userActivation.hasBeenActive) {
// 例えば、アニメーションの自動再生に進む
}
仕様書
Specification |
---|
HTML # dom-useractivation-hasbeenactive |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
hasBeenActive |
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.