Conversation
Minimal WXT-based browser extension that injects Provider.create() onto web apps. Routes fallback RPC calls through a background service worker to avoid CSP issues on the consuming page. - inpage.ts: unlisted script injected into MAIN world, creates provider, sets window.ethereum, announces via EIP-6963 - content.ts: ISOLATED world relay + injects inpage script via injectScript() for cross-browser compat (Chrome + Firefox) - background.ts: service worker that proxies RPC reads to rpc.tempo.xyz - lib/Messenger.ts: typed message schema shared across all contexts Builds for both Chrome MV3 and Firefox MV2. Co-authored-by: jxom <7336481+jxom@users.noreply.github.com> Amp-Thread-ID: https://ampcode.com/threads/T-019d50b8-fe77-779f-9ddb-d6b03aecc1b6
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
- extension.yml: builds Chrome MV3 + Firefox MV2 on push to main and PRs, uploads artifacts, comments on PRs with download links - extension-release.yml: on release, builds zips, uploads them as release assets, amends release notes with download links and install instructions Co-authored-by: jxom <7336481+jxom@users.noreply.github.com> Amp-Thread-ID: https://ampcode.com/threads/T-019d50b8-fe77-779f-9ddb-d6b03aecc1b6
Co-Authored-By: jxom <7336481+jxom@users.noreply.github.com> Amp-Thread-ID: https://ampcode.com/threads/T-019d50b8-fe77-779f-9ddb-d6b03aecc1b6
commit: |
🧩 Extension Builds
Install instructionsChrome:
Firefox:
|
|
|
Co-Authored-By: jxom <7336481+jxom@users.noreply.github.com> Amp-Thread-ID: https://ampcode.com/threads/T-019d50b8-fe77-779f-9ddb-d6b03aecc1b6
Minimal WXT-based browser extension foundation under
ref-impls/extension. InjectsProvider.create()onto web apps the user visits and routes fallback RPC calls through a background service worker to avoid CSP issues.Architecture
Changes
entrypoints/inpage.ts: unlisted script injected into MAIN world — creates provider, setswindow.ethereum, EIP-6963 announced internally by the SDKentrypoints/content.ts: ISOLATED world content script — injects inpage viainjectScript()for cross-browser compat, relays messages between page and backgroundentrypoints/background.ts: service worker that proxies RPC reads torpc.tempo.xyzlib/Messenger.ts: typed message schema shared across all three contextsCross-browser
Uses WXT's
injectScript()instead ofworld: 'MAIN'so it works on both Chrome (MV3) and Firefox (MV2). Verified both build cleanly.Prompted by: jxom