kb/data/developer.mozilla.org/en-US/docs/Glossary/Sticky_activation-0.md

11 KiB

title chunk source category tags date_saved instance
Sticky activation - Glossary | MDN 1/3 https://developer.mozilla.org/en-US/docs/Glossary/Sticky_activation reference web, html, css, javascript, documentation 2026-05-05T05:46:05.879174+00:00 kb-cron

MDN HTML HTML: Markup language

HTML reference

HTML guides

Markup languages

CSS CSS: Styling language

CSS reference

CSS guides

Layout cookbook

JavaScriptJS JavaScript: Scripting language

JS reference

JS guides

Web APIs Web APIs: Programming interfaces

Web API reference

Web API guides

All All web technology

Technologies

Topics

Learn Learn web development

Frontend developer course

Learn HTML

Learn CSS

Learn JavaScript

Tools Discover our tools

About Get to know MDN better

Blog

  1. Glossary
  2. Sticky activation

Sticky activation

Sticky activation (or "sticky user activation") is a window state that indicates a user has meaningfully and directly interacted with the window since page load. Once active, the state lasts for the duration of the session. The state is enabled following any user interaction, when the window has focus, that results in the browser generating one or more of the following:

  • A mousedown or pointerdown event for a mouse.
  • A pointerup event for any other kind of pointer.
  • A touchend event.
  • A keydown event, other than for the escape or browser shortcut keys.

The window is not user-activated by events that aren't necessarily caused by intentional interaction with the window, such as mouse move events or wheel events. Sticky activation is used to control access to certain features, blocking them if the user hasn't interacted with the page. For example, it can be used to ensure that controlled features in cross-origin frames don't run code on page load. See Features gated by user activation for more information. The UserActivation.hasBeenActive property can be used to programmatically check the current window's sticky activation state.

In this article

See also