UserActivation: isActive property

Baseline 2023

Newly 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

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android
isActive 72 79 120 60 16.4 72 120 51 16.4 11.0 72

See also

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/UserActivation/isActive