/Web APIs

UserActivation: isActive property

The read-only isActive property of the UserActivation interface indicates whether the current window has transient user activation (see transient activation).


A boolean.


Checking if a user gesture was recently performed

Use the isActive property to check whether the user is currently interacting with the page.

if (navigator.userActivation.isActive) {
  // proceed to request playing media, for example


Browser compatibility

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

See also

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.