User activation
The read-only userActivation property of the Navigator interface returns a UserActivation object which contains information about the current window's user activation state.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
| 72 | 79 | 120 | 16.4 | 72 | 16.4 | |
| The UserActivation interface provides information about whether a user is currently interacting with the page, or has completed an interaction since page load. | 72 | 79 | 120 | 16.4 | 72 | 16.4 |
| The read-only hasBeenActive property of the UserActivation interface indicates whether the current window has sticky activation. | 72 | 79 | 120 | 16.4 | 72 | 16.4 |
| The read-only isActive property of the UserActivation interface indicates whether the current window has transient activation. | 72 | 79 | 120 | 16.4 | 72 | 16.4 |
Use cases
-
Using User activation
The read-only userActivation property of the Navigator interface returns a UserActivation object which contains information about the current window's user activation state.
Cautions
- May not be supported in older browsers.
Implementation notes
- Some APIs require a secure context (HTTPS) or user activation. Check the requirements before use.