feat(extension): Browser extension prototype#973
Open
wjbeau wants to merge 59 commits into
Open
Conversation
…ndency Fixes build failure: platform-chrome was importing from @perawallet/wallet-core-config without declaring it as a dependency. The unit tests passed only because the test file mocks the import before real module resolution, masking the real build failure. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
wjbeau
marked this pull request as ready for review
July 20, 2026 09:03
Collaborator
|
Offscreen storage-shim receiver has no sender check — asymmetric with the hardened host. This receiver accepts any chromeLike.runtime.onMessage.addListener((message: unknown) => {
const msg = message as StorageChangedBroadcast | undefined
if (msg?.scope !== STORAGE_EVENT_SCOPE) return undefined
listeners.forEach(listener => listener(msg.changes, msg.areaName))
return undefined
})
---
**Comment 2 — `extensions/platform-chrome/src/dapp/permissions.ts` (`grant` / `revoke` / `pruneAddresses`)**
```markdown
**Permission-store mutators are read-modify-write with no compare-and-swap.**
`grant`, `revoke`, and `pruneAddresses` all do `map = await readMap()` → mutate → `await writeMap(map)` against a single `chrome.storage.local` key with no locking. Since the SW is event-driven and these are all `async`, two overlapping ops both read the pre-mutation map and the later `writeMap` wins.
Concrete case: a `revoke` (or `pruneAddresses` stripping a just-deleted account) interleaves with a concurrent `enable`/`grant` — if `grant` read the map before the `revoke`/prune wrote, `grant`'s write resurrects the revoked origin / pruned address. `pruneAddresses` is a security-cleanup path (removing deleted accounts from dapp grants), so losing it is the meaningful case: a revoked dapp stays connected, or a deleted account's address stays authorized.
Serialize the mutators (a simple write queue / mutex, or a read-CAS-retry loop on the storage key). |
yasin-ce
approved these changes
Jul 20, 2026
…s Emscripten glue (#1003)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Template
Description
Implements a prototype of a browser extension based on react-native-web. Broadly it is a fully featured version of Pera Wallet, but some UX/UI cleanup and lots of QA is still missing.
Notable issues remaining:
Related Issues
N/A
Checklist
Additional Notes