Transport Comparison
Purpose
Section titled “Purpose”This page helps choose the right runtime transport for your extension model. All options use the same render channel semantics, but differ in isolation, operational cost, and production fit.
Comparison matrix
Section titled “Comparison matrix”| Mode | Isolation | Transport realism | Integration complexity | Best fit | Production guidance |
|---|---|---|---|---|---|
iframe | 🟢 (browser context boundary) | 🟢 (postMessage lifecycle, origin model) | 🟡 | Untrusted extensions with strict boundaries | Recommended default for browser-hosted extensions |
Window (popup) | 🟡 (separate window context, policy depends on origin checks and lifecycle handling) | 🟢 (postMessage with explicit cross-window boundary) | 🟡 | Tool-like extensions needing an independent visible workspace | Recommended when popup UX is acceptable and strict origin/lifecycle controls are enforced |
MessagePort | 🟡 (depends on container contexts connected by ports) | 🟢 (explicit async channel with structured-clone semantics) | 🟡 | Custom runtime handshakes and orchestration bridges | Recommended as a transport primitive when you need explicit channel control |
Web Worker | 🟢 (separate worker context, no DOM access in remote) | 🟢 (async boundary, dedicated worker lifecycle) | 🟡 | Compute-heavy or DOM-independent remote runtimes | Recommended when iframe document is not needed |
Desktop IPC | 🟡 (depends on desktop process isolation and preload/capability policy) | 🟢 (explicit inter-process async boundary) | 🔴 | Electron/Tauri plugin platforms with isolated runtimes | Recommended for desktop shells with hardened IPC policy |
Socket | 🟡 (depends on runtime deployment and host policy) | 🟢 (network-level latency/reconnect/order is explicit) | 🔴 | Multi-process, cross-machine extension runtimes and live remote sessions | Recommended for advanced platforms with strong auth/protocol governance |
In-memory | 🔴 (single runtime) | 🔴 (no real transport boundary) | 🟢 | Dev harnesses, integration tests, fast diagnostics | Not recommended for production isolation |
Legend:
Integration complexity:🟢low,🟡medium,🔴high.IsolationandTransport realism:🟢strong,🟡context-dependent,🔴weak.- Ratings are comparative for typical extension-platform scenarios, not absolute guarantees.
Quick guidance
Section titled “Quick guidance”- Start with
iframefor conservative browser isolation. - Use
MessagePortwhen you need explicit custom channel wiring across containers. - Use
Web Workerwhen remote code does not need a document and you want lightweight isolation. - Use
Desktop IPCfor Electron/Tauri process-separated extension runtimes. - Use
Socketwhen runtime topology crosses process/machine boundaries. - Use
In-memoryonly for dev/test acceleration.