UserActivation: isActive property
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.
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 |
Browser compatibility
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.