---
title: "The User Activation API"
description: "Browsers gate APIs like window.open(), navigator.share() and PaymentRequest.show() on \"user activation\": a per-window transient timer started by specific events (keydown, mousedown, pointerdown/up, touchend), plus sticky activation recording that one has ever occurred."
url: "https://swe.quest/articles/the-user-activation-api-d7992ed3de9583af"
canonical: "https://webkit.org/blog/13862/the-user-activation-api/"
source: "WebKit"
published: "2023-02-15"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 6
tags: ["browsers","javascript","security"]
---

# The User Activation API

A post on [WebKit](https://swe.quest/sources/webkit.md), published 2023-02-15, 6 min read, Deep dive. Original: [https://webkit.org/blog/13862/the-user-activation-api/](https://webkit.org/blog/13862/the-user-activation-api/)

## Summary

Browsers gate APIs like window.open(), navigator.share() and PaymentRequest.show() on "user activation": a per-window transient timer started by specific events (keydown, mousedown, pointerdown/up, touchend), plus sticky activation recording that one has ever occurred. Some APIs consume the activation, so calling share() then window.open() in one click handler fails. Activation propagates across same-origin iframes but not cross-origin ones. The new navigator.userActivation.isActive and hasBeenActive properties expose this state, and open problems remain around timers expiring during slow async work and third-party iframe payments.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Browsers](https://swe.quest/tags/browsers.md) (Web & mobile)
- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)
- [Security](https://swe.quest/tags/security.md) (Security)

## Prerequisites

- DOM event handling
- JavaScript async/await ([easy posts on JavaScript](https://swe.quest/tags/javascript.md?difficulty=easy))

## Keywords

User Activation API, WebKit, Safari, Web Share API, Payment Request API, WebDriver, HTML specification

## Related posts

- [Hopping on Firefox 91](https://swe.quest/articles/hopping-on-firefox-91-43b40b5229f7a9ce.md): Mozilla Hacks · 2021-08-10 · Medium · 3 min read · Browsers, JavaScript, Frontend
  Firefox 91 enables the Visual Viewport API by default, making it available in all major browsers and letting pages read the visible viewport's size, offset and scale and react to resize and scroll events, such as when zooming or an on-screen keyboard appears.
- [Global Privacy Control (GPC) WebKit API](https://swe.quest/articles/global-privacy-control-gpc-webkit-api-320ef8eb92f93e52.md): WebKit · 2026-11-18 · Medium · 1 min read · Privacy, Browsers, Mobile, Swift
  iOS, iPadOS, visionOS and macOS 27 add a WebKit API that lets apps embedding WKWebView or SwiftUI's WebPage opt navigations into Global Privacy Control, the emerging standard for signalling opt-out of data sharing and cross-context targeted advertising (recognized under California's CCPA).
- [WebKit Features in Safari 16.1](https://swe.quest/articles/webkit-features-in-safari-16-1-3a59f2af760879c3.md): WebKit · 2022-10-24 · Medium · 7 min read · Browsers, Identity & auth, CSS, Frontend
  Safari 16.1 brings Web Push to macOS Ventura using the standard Push API, Notifications API and Service Workers, delivered via Apple Push Notification service.
- [Web Push for Web Apps on iOS and iPadOS](https://swe.quest/articles/web-push-for-web-apps-on-ios-and-ipados-7478bb28f95c6572.md): WebKit · 2023-02-16 · Medium · 7 min read · Browsers, Mobile, Communications, Frontend
  iOS and iPadOS 16.4 beta 1 adds standards-based Web Push for Home Screen web apps, using the Push API, Notifications API and Service Workers over Apple Push Notification service, with no Apple Developer Program membership required (allow \*.push.apple.com).
- [Badging for Home Screen Web Apps](https://swe.quest/articles/badging-for-home-screen-web-apps-42741870aac64b42.md): WebKit · 2023-04-25 · Medium · 4 min read · Browsers, Mobile, JavaScript, Frontend
  WebKit on iOS and iPadOS 16.4 supports the W3C Badging API, but only for web apps added to the Home Screen.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
