HTTP/2 302
x-cloud-trace-context: 0b650955d22f5eab279f7f082656a83b
location: /en-US/docs/Web/API/UserActivation
via: 1.1 google, 1.1 varnish, 1.1 varnish, 1.1 varnish, 1.1 varnish
accept-ranges: bytes
cache-control: no-store
server: Google Frontend
content-type: text/plain; charset=utf-8
date: Sun, 28 Dec 2025 17:17:19 GMT
x-served-by: cache-bfi-kbfi7400103-BFI, cache-bfi-kbfi7400103-BFI, cache-sin-wsss1830047-SIN, cache-bom-vanm7210071-BOM
x-cache: MISS, MISS, MISS, MISS
x-cache-hits: 0, 0, 0, 0
x-timer: S1766942239.194465,VS0,VE319
vary: Accept
content-length: 56
HTTP/2 200
x-content-type-options: nosniff
cache-control: public, max-age=3600
via: 1.1 google, 1.1 varnish, 1.1 varnish, 1.1 varnish, 1.1 varnish
x-cloud-trace-context: ada22257370550f04bd582de48da725e
server: Google Frontend
last-modified: Sun, 28 Dec 2025 01:10:03 GMT
referrer-policy: strict-origin-when-cross-origin
origin-trial: AxVILwizhbMjxFeHOn1P3R8niO1RJY/smaK4B4d1rLzc1gTaxtXMSaTi+FoigYgCw40uFRDwFcEAeqDR+vVLOW4AAABfeyJvcmlnaW4iOiJodHRwczovL2RldmVsb3Blci5tb3ppbGxhLm9yZyIsImZlYXR1cmUiOiJQcml2YXRlQXR0cmlidXRpb25WMiIsImV4cGlyeSI6MTc0MjA3OTYwMH0=
content-type: text/html
etag: "a4a810cfaa5d48fea22380bca14a1d5f"
strict-transport-security: max-age=63072000
expires: Sun, 28 Dec 2025 16:33:00 GMT
x-goog-meta-goog-reserved-file-mtime: 1766882816
x-goog-storage-class: STANDARD
x-frame-options: DENY
x-goog-metageneration: 1
x-goog-hash: crc32c=tHzTeA==, md5=pKgQz6pdSP6iI4C8oUodXw==
x-guploader-uploadid: AHVrFxMpvhoK5ume-HIjhot88x0PTX6ATznqdcFYeGq0C429r-DoEuTIyo-ICv47sOT3jOBOA8p-17s
content-security-policy: default-src 'self'; script-src 'report-sample' 'self' 'wasm-unsafe-eval' https://www.google-analytics.com/analytics.js https://*.googletagmanager.com assets.codepen.io production-assets.codepen.io https://js.stripe.com 'sha256-XNBp89FG76amD8BqrJzyflxOF9PaWPqPqvJfKZPCv7M=' 'sha256-YCNoU9DNiinACbd8n6UPyB/8vj0kXvhkOni9/06SuYw=' 'sha256-PZjP7OR6mBEtnvXIZfCZ5PuOlxoDF1LDZL8aj8c42rw='; script-src-elem 'report-sample' 'self' 'wasm-unsafe-eval' https://www.google-analytics.com/analytics.js https://*.googletagmanager.com assets.codepen.io production-assets.codepen.io https://js.stripe.com 'sha256-XNBp89FG76amD8BqrJzyflxOF9PaWPqPqvJfKZPCv7M=' 'sha256-YCNoU9DNiinACbd8n6UPyB/8vj0kXvhkOni9/06SuYw=' 'sha256-PZjP7OR6mBEtnvXIZfCZ5PuOlxoDF1LDZL8aj8c42rw='; style-src 'report-sample' 'self' 'unsafe-inline'; object-src 'none'; base-uri 'self'; connect-src 'self' developer.allizom.org bcd.developer.allizom.org bcd.developer.mozilla.org updates.developer.allizom.org updates.developer.mozilla.org https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com https://incoming.telemetry.mozilla.org https://observatory-api.mdn.allizom.net https://observatory-api.mdn.mozilla.net https://api.github.com/search/issues stats.g.doubleclick.net https://api.stripe.com; font-src 'self'; frame-src 'self' mdn.github.io *.mdnplay.dev *.mdnyalp.dev *.play.test.mdn.allizom.net https://v2.scrimba.com https://scrimba.com jsfiddle.net www.youtube-nocookie.com codepen.io survey.alchemer.com https://js.stripe.com; img-src 'self' data: *.githubusercontent.com *.googleusercontent.com *.gravatar.com mozillausercontent.com firefoxusercontent.com profile.stage.mozaws.net profile.accounts.firefox.com developer.mozilla.org mdn.dev wikipedia.org upload.wikimedia.org https://mdn.github.io/shared-assets/ https://mdn.dev/ https://*.google-analytics.com https://*.googletagmanager.com www.gstatic.com; manifest-src 'self'; media-src 'self' archive.org videos.cdn.mozilla.net https://mdn.github.io/shared-assets/; child-src 'self'; worker-src 'self';
x-goog-stored-content-encoding: identity
x-goog-generation: 1766884203031411
x-goog-stored-content-length: 149822
content-encoding: gzip
accept-ranges: bytes
age: 0
date: Sun, 28 Dec 2025 17:17:20 GMT
x-served-by: cache-bfi-krnt7300095-BFI, cache-bfi-krnt7300095-BFI, cache-sin-wsss1830062-SIN, cache-bom-vanm7210071-BOM
x-cache: MISS, HIT, MISS, MISS
x-cache-hits: 0, 0, 0, 0
x-timer: S1766942240.527228,VS0,VE489
vary: Accept-Encoding
content-length: 20049
UserActivation - Web APIs | MDN
UserActivation.hasBeenActive Read only
Indicates whether the current window has sticky user activation.
UserActivation.isActive Read only
Indicates whether the current window has transient user activation.
An object of this type is accessed via the navigator.userActivation property, and can be used to query information about a window's user activation state.
A user activation either implies that the user is currently interacting with the page, or has completed an interaction since page load.
User activation can be triggered by a button click, pointer touch, or some other user interaction with the page.
There are two kinds of window user activation states:
See Features gated by user activation for more information and a list of APIs that require either sticky or transient user activation.
Use navigator.userActivation to access the UserActivation object, and then UserActivation.isActive to check whether the user is currently interacting with the page (Transient activation ).
if (navigator.userActivation.isActive) {
// proceed to request playing media, for example
}
Use UserActivation.hasBeenActive to check whether the user has ever interacted with the page (Sticky activation ).
if (navigator.userActivation.hasBeenActive) {
// proceed with auto-playing an animation, for example
}
Enable JavaScript to view this browser compatibility table.