refactor: one shared extension-API module, and drive the dApp flows on Firefox (closes #153) #281
Open
clawbot
wants to merge 1 commits from
fix/issue-153-browser-api-compat into next
pull from: fix/issue-153-browser-api-compat
merge into: sneak:next
sneak:main
sneak:issue-259-e2e-in-ci
sneak:issue-275-site-approval-race
sneak:issue-188-dod-assertions
sneak:issue-152-eslint
sneak:next
sneak:issue-271-concurrent-nonce
sneak:issue-280-handlerpc-catch
sneak:chore/token-list-enrichment
sneak:feat/issue-131-transaction-view-layout
sneak:fix/116-timestamps-include-timezone
sneak:feature/expanded-warnings
sneak:fix/cross-wallet-duplicate-detection
sneak:feature/copy-flash-feedback
sneak:feature/issue-82-new-address-warning
sneak:feature/82-warn-new-address
sneak:issue-99-block-number-external-link
sneak:issue-99-block-number-styling
sneak:feature/82-zero-history-warning
sneak:fix/issue-99-block-number-link-copy
sneak:fix/99-block-number-clickable
sneak:fix/87-consistent-error-display-v2
sneak:fix/87-consistent-error-display
sneak:fix/consistent-error-display
sneak:fix/77-confirm-tx-persist
sneak:fix/issue-72-address-token-tx-history
sneak:fix/70-confirm-tx-contract-display
sneak:fix/issue-58-receive-address-consistency
sneak:fix/59-transaction-view-ui-policies
sneak:fix/55-swap-show-own-address
sneak:feature/show-private-key
sneak:feat/message-signing
1 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
| 34c1b00710 |
refactor: one shared extension-API module, and drive the dApp flows on Firefox (closes #153)
All checks were successful
check / check (push) Successful in 28s
Every call site that touched `browser.*` or `chrome.*` now goes through `src/shared/browserApi.js`, the only file in the tree that names either. It exposes lazily-resolved namespace handles for events and synchronous methods, and promise-returning wrappers for everything that is callback-shaped on Chrome. Callers await; `runtime.lastError` is gone, folded into the rejection the wrapper produces on the Chrome path. The Firefox suite gains the four dApp round trips the issue's definition of done asks for — `eth_requestAccounts`, `personal_sign`, `eth_sendTransaction`, and a closed approval window rejecting with EIP-1193 4001 — driven through the real content script, background page and approval windows. `--network none` was thought to rule that out because it leaves no `http://` origin to inject into; loopback survives it, so the page and a JSON-RPC node are served from 127.0.0.1 inside the container and the run still reaches nothing but itself. That harness refutes the premise it was built to verify. On Firefox 153.0.3, `browser.*` honours a trailing Chrome-style callback and does populate `runtime.lastError`, both measured directly, and all four flows pass against the unconverted code. So this is a uniformity and coverage change, not a repair of a broken target; the PR records the measurement in full. One real defect is fixed on the way past: the window id written back into a pending approval after `windows.create()` was unguarded, so an approval settled during the open — an address switch will do it — dereferenced a deleted entry. |