Capture, inspect and audit window.postMessage traffic — in a DevTools panel, on
every frame, without changing how the page behaves.
Reading postMessage by pasting console.log into a page fails in three ways: it
sees one frame, it starts too late, and it floods the console. v3 is a rewrite
around three rules:
- Observe, never modify. The probe never wraps
window.postMessage. Replacing it rewritesevent.sourceto the receiving window, which breaks pages that validate the sender. Capture is receive-only. - Be early.
document_start+all_frames+match_origin_as_fallback+ the MAIN world, soabout:blank,srcdoc,data:andblob:frames are covered before any page script runs. - Never break the page. Bounded snapshots, a
try/catchon every capture path, and no page object is mutated.
- DevTools panel with a virtualised list and Overview / Payload / Raw detail, sender attribution, search, direction filters, keyboard navigation and JSON export.
- Every frame, from the start: iframes,
srcdoc,about:blankand messages sent during page load are captured. - Trusted attribution:
event.originplus self / parent / child / other, even for cross-origin senders. - JSON strings, parsed: payloads that were
JSON.stringify-ed open as a tree with a Parsed / Text switch; the list shows the inner discriminator. - History across reloads: the worker keeps a per-tab ring buffer and persists
a compact copy to
storage.session, so you can open the panel after the bug. - Recording controls: per-tab recording plus a master switch.
- Popup theme switch: System / Light / Dark, remembered across sessions.
- Local only: no network, no telemetry, no remote code.
JSON-encoded payloads open as a tree, with a Parsed / Text switch.
Per-tab recording, a master switch, and a System / Light / Dark theme.
pnpm install
pnpm buildOpen chrome://extensions, enable Developer mode, choose Load unpacked
and select .output/chrome-mv3.
The published listing is the v2 build: https://chromewebstore.google.com/detail/postmessage-catcher/henlmhlhpgnkeecjjcbhhcfmecohnilo. v3 is not submitted yet.
- Open any regular
http(s)page and DevTools → postMessage. - Interact with the page, or reload it to catch the load-time traffic.
- Select a message to inspect routing, payload and warnings.
⌘F/Ctrl+Ffilters;↑/↓moves the selection;⌘C-style copy and Export are in the toolbar.- The popup switches recording per tab and globally.
targetOriginis not shown: it is only visible on the sending side, and patching the sending side is the thing that breaks pages.- The sender's
frameIdis not knowable cross-origin; the panel shows origin and relationship. MessagePort,BroadcastChannelandWorkertraffic is not captured yet.- Frames that do not execute scripts (
sandboxwithoutallow-scripts) cannot be probed. chrome://, extension pages and the Chrome Web Store cannot run content scripts.- The panel follows the DevTools theme; the popup theme switch is separate.
Requires Node 22+ and pnpm 12.
pnpm dev # WXT dev server
pnpm build # production build → .output/chrome-mv3
pnpm compile # tsc --noEmit
pnpm lint # ESLint
pnpm test # Vitest, including release-docs checks
pnpm test:probe # execute the built MAIN-world probe without a browser
pnpm test:e2e # real browser (set CHROME_BIN to Chrome for Testing)
pnpm check # compile + lint + test + build + probe smoke test
pnpm zip # .output/postmessage-catcher-<version>-chrome.zip
pnpm store:assets # compose store images (set CHROME_BIN)
pnpm changelog --minor # bump version + prepend CHANGELOG.mdBranded Chrome no longer honours --load-extension, so the browser checks need
Chrome for Testing or Chromium.
| Path | Role |
|---|---|
entrypoints/probe.content.ts |
MAIN-world observer (no chrome.*) |
entrypoints/bridge.content.ts |
ISOLATED-world state + batching |
entrypoints/background.ts |
Router, ring buffer, badge |
entrypoints/devtools/, entrypoints/panel/ |
DevTools panel |
entrypoints/popup/ |
Toolbar popup |
lib/ |
Protocol, snapshot, attribution, theme, buffers — unit tested |
scripts/store/ |
Store asset composer and frames |
docs/ |
Architecture, privacy, release process, research notes |
store/ |
Chrome Web Store copy and exact-size assets |
.agents/ |
Skills and notes for coding agents |
legacy/ |
The v2 implementation, for reference |
Everything is processed locally. See docs/privacy.md.
- Architecture — how capture, routing and the panel work.
- Release process — changelog, store assets, zip, tag.
- Research notes — the November 2026 groundwork.
- Changelog.
Issues and pull requests are welcome. Before opening a PR:
- Run
pnpm check(andpnpm test:e2efor runtime changes). - Add a Vitest test for pure logic in
lib/. - Read
AGENTS.md— it lists the invariants that keep the extension from breaking the pages it inspects.
Inspired by postMessage-logger. Thanks to chrome-plugin-demo and youtube-translator for early reference material.
MIT — see LICENSE.


