Firefox Tomorrow

web api instance property

UserActivation: hasBeenActive property

View on MDN ↗

The read-only hasBeenActive property of the UserActivation interface indicates whether the current window has sticky user activation.

Value

A boolean.

Examples

Checking if a user gesture was ever performed

Use the hasBeenActive property to check whether the user has interacted with the page since it was loaded.

if (navigator.userActivation.hasBeenActive) {
  // proceed with auto-playing an animation, for example
}

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also