Repository navigation
Show a retry overlay when the checkout window is blocked - #791
Conversation
f94ab3c to
7f31272
Compare
Bundle Size Budgets
Bundle and package sizeWeb bundle sizes cover shipped runtime JavaScript. Package sizes cover the full published archive, including any source maps, declarations, and documentation it contains.
Web package files (uncompressed)These are uncompressed file sizes; they do not sum to the compressed package size above.
How sizes are measuredMeasured from the PR base SHA and PR head SHA. Web bundle rows sum shipped |
| <slot name="overlay-blocked"> | ||
| <div class="overlay-content-wrapper"> | ||
| <div class="overlay-content"> | ||
| Your browser blocked the checkout window. <br /> |
There was a problem hiding this comment.
I wonder if we should think about localisation at some point
There was a problem hiding this comment.
Good callout. Web doesn't localize the overlay yet, and merchants can provide their own copy through the overlay and overlay-blocked slots, but localized defaults would be nice. I created an issue so we can keep it on our radar.
d38fe43 to
0001bae
Compare
| <slot name="overlay-blocked"> | ||
| <div class="overlay-content-wrapper"> | ||
| <div class="overlay-content"> | ||
| Your browser blocked the checkout window. <br /> |
There was a problem hiding this comment.
Wondering if this wording is better
| Your browser blocked the checkout window. <br /> | |
| Your browser blocked the checkout window from opening. <br /> |
2930889 to
a06777a
Compare

What changes are you making?
Problem. When the browser blocks the checkout window (
window.openreturnsnull), the overlay still says "Continue your purchase in the checkout window". There is no window, the "checkout window" link does nothing, and the only way out is to close the overlay. Blocks usually happen because the host page does work (for example, creating a cart) between the buyer's click andopen(), and browsers only allow a new window shortly after a click.Change. The overlay now shows a blocked state: "Your browser blocked the checkout window." with Open checkout and Close. Open checkout calls
window.openagain from the buyer's own click, which browsers allow, so the common case recovers in one tap.start, thenclosewhen checkout endsclose(), or atargetchange)closedisplay: noneon the element or::part(overlay))Other details:
close, whether it's our Open checkout button, a store's own button in theoverlay-blockedslot, or the store's code callingopen()again.log-level="warn".blockedtelemetry is nowretryable: true, withisRetry: truewhen a retry is blocked again.overlay-blockedslot next to the existingoverlayslot, anddata-state="blocked"on the dialog switches between them.#isDialogVisible()so both states share it.<dialog>element's nativecloselisteners ignore the event if the dialog is open again. The native event fires asynchronously, and a retry closes and re-shows the dialog in the same task.Not in this PR: accessible names for the overlay (both states).
How to test
dev web testanddev web lint. New tests cover the blocked overlay, the retry, andclosewhen the blocked overlay is closed.pnpm sample): under Flow, choose Use existing checkout source and paste a cart permalink (https://your-store.myshopify.com/cart/<variant-id>:1). In the DevTools console, runsetTimeout(() => document.querySelector('shopify-checkout').open(), 8000), then don't click or type on the page for 8 seconds (a click gives the page a fresh user activation, so the window would open). The browser blocks the window and the overlay shows the blocked state. Click Open checkout and checkout opens. Run it again and click Close to seeclosein the Events panel.window.open = () => nullin the console first (reload to undo).Before you merge
Important
platforms/web/README.md)Screen.Recording.2026-09-28.at.11.40.53.AM.mov