The read-only hasBeenActive
property of the UserActivation
interface indicates whether the current window has sticky user activation (see sticky activation).
The read-only hasBeenActive
property of the UserActivation
interface indicates whether the current window has sticky user activation (see sticky activation).
A boolean.
Use the hasBeenActive
property to check whether the user has ever interacted with the page.
js
if (navigator.userActivation.hasBeenActive) { // proceed with auto-playing an animation, for example }
Specification |
---|
HTML Standard # dom-useractivation-hasbeenactive |
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
hasBeenActive |
72 | 79 | No | No | 60 | 16.4 | 72 | 72 | No | 51 | 16.4 | 11.0 |
© 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/hasBeenActive