InfraLayers LogoInfraLayers
OPEN SOURCEPublished on npmActive

MV3 Proxy Kit

v0.1.0

Cross-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.

Chrome + FF
Cross-Browser MV3
0 Deps
Runtime Dependencies
4 Exports
Modular Subpaths
E2E Verified
Reference Extension
Capabilities & Real-World Value

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:

Interactive Persona CapabilitiesClick any card to inspect the runtime flow
Proxy / VPN Dev
Cross-Browser Parity

Write Proxy Routing & Auth Once

Stop maintaining separate Chrome and Firefox codebases for 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.
Chrome + Firefox Parity
Click to View →
MV3 Migration Eng
Suspension-Safe State

Survive 30s Service Worker Sleep

Chrome terminates idle MV3 background service workers after ~30 seconds, wiping global variables and breaking active proxy credentials mid-session. createPersistedState lazily auto-hydrates from session storage, deduplicates concurrent reads, and prevents stale reads from overwriting newer writes.
Zero Lost State on Sleep
Click to View →
Any MV3 Team
Modular & Testable

Import Only the Modules You Need

Building a non-proxy Chrome or Firefox extension? Import tree-shakeable /state or /messaging with zero proxy code bundled — and inject fake BrowserAPI mocks to unit-test extension logic directly in Node.js.
4 Modular Subpath Exports
Click to View →
Quick Integration

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.

Quick Install
Install via npm in your Manifest V3 extension project:
Package:@infralayers/mv3-proxy-kit (v0.1.0)Subpaths:. | /state | /messaging | /proxy
npm install @infralayers/mv3-proxy-kit

Read the Full Documentation & Guide

Open the complete developer guide for @infralayers/mv3-proxy-kit — covering step-by-step setup, full module APIs, and Chrome & Firefox manifest reference.

Engineering Highlights

Architected 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.

01 // CROSS-BROWSER AUTH

Unified Chrome & Firefox Proxy Auth

registerProxyAuth transparently bridges Chrome MV3 (webRequestAuthProvider + asyncBlocking callback) and Firefox MV3 (webRequestBlocking + Promise return) with strict browser detection.

02 // MULTI-MODE ROUTING

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.

03 // SUSPENSION-SAFE STATE

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.

04 // MODULAR SUBPATHS

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.

Cross-Browser Parity

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.

CapabilityChrome MV3Firefox MV3Subpath
Proxy Auth (registerProxyAuth)webRequestAuthProvider + asyncBlockingwebRequestBlocking + Promise return/proxy
Declarative HTTP / HTTPS Proxymode: "fixed_servers" + bypassListproxyType: "manual" (http/ssl + passthrough)/proxy
SOCKS4 / SOCKS5 Proxyfixed_servers singleProxy.schemeproxyType: "manual" (socks + socksVersion)/proxy
Hosted PAC Script (pac_url)mode: "pac_script" (pacScript.url)proxyType: "autoConfig" (autoConfigUrl)/proxy
Suspension-Safe Statechrome.storage.sessionbrowser.storage.session (local fallback)/state
Typed Messaging Channelchrome.runtime.onMessage / sendMessagebrowser.runtime.onMessage / sendMessage/messaging

Build Reliable MV3 Extensions Today

Free, MIT-licensed, and published on npm. Need custom Chrome/Firefox MV3 architecture, VPN extensions, or Manifest V2-to-V3 migration?