fix: improve payment autofill and browser integration - #25
Conversation
📝 WalkthroughWalkthroughThe extension now supports persisted cardholder fields, frame- and shadow-root-aware autofill with structured results, cryptographically generated card data, and refactored context-menu handling. CI adds concurrency control, failure logs, and separate Chrome and Firefox builds. ChangesExtension autofill behavior
CI workflow execution
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant BrowserContextMenus
participant Background
participant Storage
participant ContentScript
participant PaymentFrame
BrowserContextMenus->>Background: select card action with frameId
Background->>Storage: load cardholder name and country
Background->>ContentScript: send fillCard to selected frame
ContentScript->>PaymentFrame: find fields across document and shadow roots
PaymentFrame-->>ContentScript: filled field count
ContentScript-->>Background: structured FillResult
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/ci.yml:
- Around line 40-49: Update the typecheck step running yarn compile so failures
remain visible when output is piped through tee typecheck.log. Configure the
step with bash pipefail behavior, using shell: bash or an equivalent set -o
pipefail command, while preserving the existing log artifact upload flow.
In `@entrypoints/content.ts`:
- Around line 250-253: Normalize card.expiry to the combined input’s required
MM/YY format in the expiryEl branch before calling fillInputAsync. Use the
existing expiry value’s month and year components, reducing a four-digit year to
its final two digits while preserving already-normalized values, then pass the
normalized value to fillInputAsync and retain the existing filledFields
behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 6bb5cdbb-720b-4ce3-b176-11e09efb2049
📒 Files selected for processing (4)
.github/workflows/ci.ymlentrypoints/background.tsentrypoints/content.tsutils/cards.ts
|
Automation update:
A separate unresolved review item remains in |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@entrypoints/sidepanel/App.tsx`:
- Line 132: Replace the local generateCardNumber()/generateLuhn() flow in the
side-panel card-row generation, JCB regeneration, and error-test-card copy paths
with the exported card-number helper from utils/cards.ts. Remove the duplicated
Math.random-based generator and reuse the shared helper consistently for all
generated card values.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 93fb9005-9218-43e2-b0e9-d073e304f4e6
📒 Files selected for processing (3)
entrypoints/content.tsentrypoints/sidepanel/App.tsxutils/cards.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- utils/cards.ts
- entrypoints/content.ts
What changed
about:blank,blob:and origin-fallback framesMath.random()in generated card data with Web Crypto and unbiased rejection samplingRoot causes
Payment providers commonly isolate card fields inside cross-origin iframes. The previous content script only ran in the top frame, so Stripe Elements and PayPal hosted fields were often skipped. Individual context-menu fills were also broadcast to every frame instead of the frame where the user clicked.
The Chrome toolbar action attempted to close the side panel by disabling and immediately re-enabling it, which is not a reliable close operation.
Validation
Summary by CodeRabbit
New Features
Bug Fixes
Chores