UserActivation: isActive property
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since November 2023.
The read-only isActive property of the UserActivation interface indicates whether the current window has transient user activation.
Value
A boolean.
Examples
>Checking if a user gesture was recently performed
Use the isActive property to check whether the user is currently interacting with the page.
js
if (navigator.userActivation.isActive) {
// proceed to request playing media, for example
}
Specifications
| Specification |
|---|
| HTML> # dom-useractivation-isactive> |