Skip to content

fix(extension): fill cards on airline, split-frame, single-page and saved-card checkouts - #364

Merged
kitlangton merged 8 commits into
devfrom
gauntlet-checkout-cards
Dec 2, 2026
Merged

kitlangton merged 8 commits into
devfrom
gauntlet-checkout-cards

Conversation

@kitlangton

@kitlangton kitlangton commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Deadbolt now fills cards correctly on four kinds of real checkout it used to get wrong: airline payment steps, split provider frames, form-less single-page checkouts, and saved-card "enter your security code" prompts.
Each is a new page in the extension's end-to-end gauntlet that fails on dev and passes here. Logins and passkeys aren't touched, and nothing outside extension/ changes.

❌ Before

  1. Airline checkout: the card number and code stay disabled until a card type is chosen, so they were skipped. The birth date's Month/Day/Year selects in the same form were taken for the expiry (the birthday came out as 8//).
  2. Provider frames (one field per frame): pressing Esc or clicking away inside the frame left the card menu open in the page above it.
  3. Single-page checkout: the open toolbar popup never noticed the card fields a radio button drew. Shipping and billing under sibling headings were treated as one address.
  4. Saved-card prompt: a "Year" box beside the security code was filled as the expiry year, and a bank's texted "Security code" step was offered the card.

✅ After

  1. The card type is chosen first (by name or by the VI/MC/AX/DS codes booking engines use), then the number and code are written once the page enables them. Birth-date selects and typed boxes under a "Date of birth" legend are the birthday's.
  2. The frame tells the background when the user leaves its field or it moves, so the menu closes or follows. A frame scanned before the page gave it its size is scanned again once it has one, so every hosted field reports and is filled (the fourth frame of the split-frames page stayed silent on about half of its second loads).
  3. The popup re-lists cards when the tab's fields change. Each heading starts its own address section.
  4. A lone Month or Year with no other expiry part is nothing. A code the bank sent is never the card's. A saved card's brand ("Visa ending in 4242") still marks a lone security code as a card's.
- fill fields in page order; skip anything disabled
+ choose the card type first; wait (up to 2.5 s) for the number and code it enables
- bare "Month"/"Year" in a card's form -> expiry
+ -> birthday if its options or group say so; expiry only with its other part beside it
- frame field's menu closes only on what the top page sees
+ the frame reports Esc, typing, clicks and moves; the menu closes or follows
- popup lists a tab's cards once, when opened
+ and again whenever that tab's fields change

📊 Proof: the four new gauntlet pages, headless Chromium, against dev's source and this branch

Gauntlet page Before After
airline-card-checkout ❌ ✅
braintree-split-frames ❌ ✅
spa-radio-checkout ❌ ✅
saved-card-cvv ❌ ✅
below-fold-checkout, masked-card, formsFrames (existing) ✅ ✅

The four new pages fail 15 checks on dev's source and none here. 26 new unit tests (1060 → 1086); the frozen detection corpus stays at 163/163.

👀 Read: resolveParts in extension/src/content/forms.ts, which decides whether a bare Month/Year/brand select is a card's, a birthday's or nothing. The order matters: future-year selects resolve first so a month beside one knows it's an expiry. Three choices go past the written plan, on purpose: bare "visa" and "discover" do not count as payment words (they'd turn "Discover what's new" newsletters and travel-visa forms into card forms), only forms like "Visa ending in 4242" do; 3-D Secure program names ("Visa Secure", "Identity Check", "SafeKey") mark a code as the bank's; and a brand select with no other card field near it is ignored as a filter. The rest is routine.

🔍 From a checkout hardening pass over the gauntlet · no user reports · one existing formsFrames check also fails on dev (it read the frame a beat before the last field was written); its wait is fixed here

Checks run

In extension/:

  • bun run typecheck: clean
  • bun test: 1086 pass, 0 fail (38 files)
  • bun run test:corpus (bun corpus/score.ts --gate): 163/163 pages exact, 0.0% decoy false-trigger, gate pass
  • bun run build: built 5 entries
  • GAUNTLET_PAGES=airline-card-checkout,braintree-split-frames,spa-radio-checkout,saved-card-cvv,below-fold-checkout,masked-card bun e2e/run.ts --only gauntletTraps,gauntletFlows,formsFrames: all passed, 97 checks; all six pages PASS, formsFrames passes (gauntletFlows has no page in that list, so it ran nothing)
  • The same four new pages against dev's extension/src: all four FAIL, 15 failed checks

From the repo root:

  • bash scripts/file-size.sh: 0 errors; no new file over the warning line (content/forms.ts 562, content/formfill.ts 477, bg/forms.ts 658)
  • No Rust, release workflow or site files changed; no new dependencies

Detection (content/forms.ts):
- A select of card brands, by name or by the two-letter codes booking
  engines use, is the card's type; alone, it's a filter and nothing.
- A birth date's Month, Day and Year inside a card's form are the
  birthday's; a bare Month or Year is an expiry only with its other part.
- A guessed security code needs three or four digits of room, and
  "Verification code" alone no longer reads as one.
- A code the bank sent (3-D Secure by name, or "we texted a code") is
  never the card's; a saved card's brand ("Visa ending in 4242") keeps a
  lone security code a card's.
- Fields under sibling headings take the heading just before them, so
  shipping and billing in one wrapper are two sections.

Filling (content/formfill.ts, transform.ts, fill.ts):
- The card's type is chosen first; a number and code the page keeps
  disabled until then are approved to wait, and written once enabled.
- A card type select takes the brand by name, alias or code, from the
  number's first digits when the card was saved with no brand.

Frames and popup (bg/forms.ts, content/inline.ts, popup.ts):
- A card menu opened for a provider's frame field closes when the user
  types, clicks away or presses Esc in that frame, and follows the field
  when it moves; the frame hears when the top page closes it.
- An open popup re-lists a tab's cards when its fields change, and a
  card with none of what the fields take isn't asked for.
airline-card-checkout (type-gated number and code, bare Month/Year twice),
braintree-split-frames (one hosted field per frame, a look-alike on
another site), spa-radio-checkout (no <form>, card fields drawn on a
radio, shipping and billing under sibling headings) and saved-card-cvv
(a lone security code among short decoys, then a bank's texted code).

The harness gains a second, provider-named origin and a popup handle.
Also waits for the last-written field in the formsFrames popup check,
which read the frame a beat before the code landed.
…ses, and review cleanups

- A birth date's typed Month, Day and Year under its legend (or a group so
  labelled) inside a card's form are the birthday's: they were taken for a
  second expiry. A named group also bounds the birthday, so its parts no
  longer pull the expiry beside it in.
- Date-part resolution is one pass over each select's options, read once;
  a field's scope is its cluster throughout.
- A frame hears its menu went only when that was its open menu: not for a
  pill, nor when the top page closes an older menu while a newer one for
  the same frame is open. A click on a frame's field whose menu is already
  open doesn't ask for it again.
- The wait for fields a page enables later reads the value after the wait
  instead of assigning it in the loop's condition.
- The airline trap's card type select is bare GDS codes, so the e2e covers
  matching a brand by code alone.
…y, and tell a frame its menu went after a failed pick or a lock

- Every field in a group that names a birth date is the group's, the ones
  the page names itself (autocomplete, name) too: a "dob_day" under the
  legend no longer makes the card's Month and Year beside the group a
  birthday's.
- A frame hears its menu went unless the pick's values reached it: a pick
  Touch ID turned down, or one whose fields stopped showing, left the frame
  watching its field for a menu that had gone. Locking tells it as well.
A cross-site frame can be scanned before the page above has given it its
size. Its fields aren't drawn yet, nothing in it changes when they are, and
so it never reported them: a hosted card field in such a frame was left out
of a fill picked from another frame, until the user focused it.

The split-frames trap now waits for all four of its frames to report (the
other site's could stand in for a hosted field's still to come) and fails
when one doesn't, which is what showed this: the fourth stayed silent on
about half of the page's second loads.
…ed date part isn't taken twice

- A select of card brands with no name of its own no longer makes its
  cluster a card's: a statement's filter (All / Visa / Mastercard, with a
  Month and a Year) had made its own Month and Year an expiry, and they it
  a card's type.
- A month or year goes to a birthday beside it only when that birthday
  still has no month, and stays the card's beside an expiry part still
  without its other: a birth date right before the expiry no longer takes
  the expiry's month, nor one right after a typed expiry its year.
- A frame's field whose menu the top page already has open is turned away
  once, before the page is scanned, for logins and forms alike.
…t lacks it

- A bare Month or Year goes to a birthday only when it's right beside the
  birthday's day or year and that birthday still lacks the part it would
  be, its month or its year: a typed expiry before a birth date that
  starts with its day keeps its Year, an expiry with its year first keeps
  its Month, and a typed Year after a birth date's month and day is never
  a second expiry's.
- A disabled field is unloaded like a select with nothing to choose, in
  one place, instead of the same two checks at each use.
@kitlangton
kitlangton force-pushed the gauntlet-checkout-cards branch from fafde53 to 51ce4d6 Compare December 2, 2026 22:31
…e birthday's year

A bare month or year beside a birthday now takes the part it is, instead
of only being kept out of the expiry: a typed Year after a birth date's
month and day had no role at all, and after its day and month (the month
beside it, not the day) was still read as a second expiry year. A
birthday's month counts as a neighbour when it has its day beside it, and
a box is read by its words only when its options say nothing.
@kitlangton
kitlangton merged commit ea0124b into dev Dec 2, 2026
13 checks passed
@kitlangton
kitlangton deleted the gauntlet-checkout-cards branch December 2, 2026 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant