Since November 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
The read-only userActivation property of the Navigator interface returns a UserActivation object which contains information about the current window's user activation state.
A UserActivation object.
Use UserActivation.isActive to check whether the user is currently interacting with the page (Transient activation).
if (navigator.userActivation.isActive) {
// proceed to request playing media, for example
}
Use UserActivation.hasBeenActive to check whether the user has ever interacted with the page (Sticky activation).
if (navigator.userActivation.hasBeenActive) {
// proceed with auto-playing an animation, for example
}
| Specification |
|---|
| HTML> # dom-navigator-useractivation> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
userActivation |
72 | 79 | 120 | 60 | 16.4 | 72 | 120 | 51 | 16.4 | 11.0 | 72 | 16.4 |
UserActivationUserActivation.hasBeenActiveUserActivation.isActive
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/userActivation