MV3 Proxy Kit
v0.1.0Cross-Browser Manifest V3 Proxy & Extension Toolkit
Abstracts Chrome and Firefox Manifest V3 discrepancies behind one clean API — covering per-request proxy authentication (onAuthRequired), HTTP/HTTPS/SOCKS4/SOCKS5 & PAC URL routing, lazy auto-hydrating state, and tree-shakeable /state, /messaging, and /proxy subpaths reusable in any MV3 extension.
Built for Real-World MV3 Challenges
Manifest V3 splits Chrome and Firefox across proxy authentication, routing schemas, and service-worker lifecycles. Here is how @infralayers/mv3-proxy-kit removes that cross-browser complexity:
Write Proxy Routing & Auth Once
webRequestAuthProvider vs. webRequestBlocking or fighting Firefox silently ignoring raw PAC strings. One typed API covers HTTP, HTTPS, SOCKS4/5, bypass lists, and hosted PAC URLs.Survive 30s Service Worker Sleep
createPersistedState lazily auto-hydrates from session storage, deduplicates concurrent reads, and prevents stale reads from overwriting newer writes.Import Only the Modules You Need
/state or /messaging with zero proxy code bundled — and inject fake BrowserAPI mocks to unit-test extension logic directly in Node.js.Drop-In Setup for Chrome & Firefox MV3
Install once and import either the full toolkit or individual modular subpaths (/state, /messaging, /proxy) with zero runtime dependencies.
@infralayers/mv3-proxy-kit (v0.1.0)Subpaths:. | /state | /messaging | /proxynpm install @infralayers/mv3-proxy-kitArchitected from First Principles
Engineered to eliminate the sharpest Manifest V3 cross-browser pitfalls — from Chrome asyncBlocking callbacks to Firefox manual SOCKS routing and 30-second service worker suspension.
Unified Chrome & Firefox Proxy Auth
registerProxyAuth transparently bridges Chrome MV3 (webRequestAuthProvider + asyncBlocking callback) and Firefox MV3 (webRequestBlocking + Promise return) with strict browser detection.
Declarative, SOCKS4/5 & PAC URL Routing
ProxyManager and setProxyConfig support fixed_servers (HTTP, HTTPS, SOCKS4, SOCKS5 + bypass lists), pac_url, and direct modes without Firefox ignoring raw PAC strings.
Lazy Auto-Hydrating MV3 State
createPersistedState backs your state with storage.session (with local fallback), deduplicates concurrent reads, and prevents stale hydration from overwriting newer writes.
Reusable Primitives for Any MV3 Extension
Zero runtime dependencies with tree-shakeable /state, /messaging, and /proxy subpaths plus injectable BrowserAPI mocks for fast Node.js unit testing.
Chrome & Firefox MV3 Matrix
Every browser discrepancy is abstracted behind one typed API — with modular subpaths so non-proxy extensions import only what they need.
| Capability | Chrome MV3 | Firefox MV3 | Subpath |
|---|---|---|---|
| Proxy Auth (registerProxyAuth) | webRequestAuthProvider + asyncBlocking | webRequestBlocking + Promise return | /proxy |
| Declarative HTTP / HTTPS Proxy | mode: "fixed_servers" + bypassList | proxyType: "manual" (http/ssl + passthrough) | /proxy |
| SOCKS4 / SOCKS5 Proxy | fixed_servers singleProxy.scheme | proxyType: "manual" (socks + socksVersion) | /proxy |
| Hosted PAC Script (pac_url) | mode: "pac_script" (pacScript.url) | proxyType: "autoConfig" (autoConfigUrl) | /proxy |
| Suspension-Safe State | chrome.storage.session | browser.storage.session (local fallback) | /state |
| Typed Messaging Channel | chrome.runtime.onMessage / sendMessage | browser.runtime.onMessage / sendMessage | /messaging |