UserActivation: hasBeenActive 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 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.

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

Specifications

Specification
HTML
# dom-useractivation-hasbeenactive

Browser compatibility

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
hasBeenActive

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

See also