GO-V.ORG
As seen in

Transient activation

Transient activation (or "transient user activation") is a window state that indicates a user has recently directly and meaningfully interacted with the window.

**Transient activation** (or "transient user activation") is a window state that indicates a user has recently directly and meaningfully interacted with the window.

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.

Transient activation expires after a timeout (if not renewed by further interaction), and may also be consumed/deactivated after using some gated features (such as Window.open()).

Transient activation is commonly used as a mechanism for ensuring that a web API can only function if triggered by user interaction.
For example, scripts cannot arbitrarily launch a popup that requires _transient activation_ ⁠— it must be triggered from a UI element's event handler.
See [Features gated by user activation](/docs/Web/Security/Defenses/User_activation) for information about APIs that require _transient activation_.

The UserActivation.isActive property can be used to programmatically check the current window's transient activation state.

## See also

- [Comparison between transient and sticky activation](/docs/Web/Security/Defenses/User_activation#comparison_between_transient_and_sticky_activation) in _Features gated by user activation_
- Related glossary terms:
- Sticky activation
- UserActivation.isActive
- [HTML Living Standard > Transient activation](https://html.spec.whatwg.org/multipage/interaction.html#transient-activation)

source: MDN Web Docs mirror · page

Cite this

"Transient activation". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Glossary/Transient_activation

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·