demo · v142

Post-Navigation Popups, AudioContext, Payment

The compatibility flakiness this Chrome 142 change cleaned up. Three APIs are user-activation gated: window.open, AudioContext.resume(), and navigator.requestPaymentRequest.show(). Pre-142, a same-origin location.href = "/checkout" after the user's click dropped the activation, so the checkout page had to ask the user to click again for the payment sheet to appear. Sticky activation across same-origin renderer-initiated nav fixes it. Try each scenario — the activation history is shown live.

navigator.userActivation.hasBeenActive
—
navigator.userActivation.isActive
—

1. window.open after same-origin nav

Pre-142: location.href reset the activation; the post-nav window.open was popup-blocked. With sticky activation, the popup opens.

—

2. AudioContext.resume() after nav

Music players that load a new track via SPA-style nav used to need a second user-gesture to start audio. Now AudioContext.resume() works on the new view.

—

3. PaymentRequest.show() after redirect

Stores that POST to a same-origin /pay endpoint hit a 303 → /pay/sheet pattern. Pre-142 the sheet wouldn't show; users saw nothing. Sticky activation keeps the gesture across the redirect.

—

The probe at the top is the actual UserActivation object on this page. Click any of the buttons to mint a fresh activation, then watch the values flip.

relevant API

// Chrome 142+: this works even after location.href = "/checkout"
location.href = "/checkout";
// new page loads, on DOMContentLoaded:
await navigator.userActivation.hasBeenActive; // still true (same-origin nav)
window.open("/help");                          // not blocked
audioCtx.resume();                             // succeeds

see also