UserActivation.isActive

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The read-only isActive property of the UserActivation interface indicates whether the current window has transient user activation (see transient 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.

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

Specifications

Specification
HTML Standard
# dom-useractivation-isactive

Browser compatibility

BCD tables only load in the browser

See also