fix: add fallback popup window for tx/sign approval requests (closes #4) #17
Reference in New Issue
Block a user
Delete Branch "fix/tx-approval-popup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
requestTxApprovalandrequestSignApprovalwere missing theopenApprovalWindowfallback. Whenchrome.action.openPopup()fails (not triggered by user gesture in MV3), no popup appeared. Users had to manually click the toolbar icon.Fix
All three approval types now use the same pattern: try
openPopup()→ fall back to centered standalone window. This matches whatrequestApproval(connection requests) already did.make checkpasses (prettier clean, 14 tests).No fallbacks. Fix the issue and make the correct thing pop up.
764ced687bto65cb4d2f64Rebased on main (after PR #18 merge).
make checkpasses. Re-assigned to sneak.Understood — will rework to fix the actual popup mechanism rather than adding a fallback window. Need to investigate why the toolbar popup fails to open in the first place and fix that root cause.
Also noticed the PR fixes
parseInt(approvalId, 10)→approvalId(since IDs are UUIDs not ints) — that's a legitimate bug fix that should stay.Spawning an agent to investigate the root cause of the popup failure.
65cb4d2f64tof2e44ff4abReworked: removed
openPopup()entirely fromrequestTxApproval()andrequestSignApproval(). Now useswindows.create()directly, which is the correct mechanism for programmatic approval popups (works from any context, no user gesture required). This matches the standard pattern used by other extension wallets.Site-connection approvals (
requestApproval()) still useopenPopup()with window fallback since those can rely on the user clicking the toolbar icon.Also fixed popup dimensions to 360x600 (matching README spec).
make checkoutput: 2 test suites passed (14 tests), prettier clean.Reworked — no more fallbacks. Root cause:
action.openPopup()was called from the background script during async RPC handling, which isn't a user gesture context (fails silently in Chrome MV3 and Firefox MV2).Fix:
requestTxApproval()andrequestSignApproval()now usewindows.create()directly — the standard extension pattern for programmatic popups. Also fixed popup dimensions to 360x600 per README spec.Site connection approval (
requestApproval()) left unchanged since those work via toolbar click.make checkpasses.