GitShow/vercel/bidc
vercel

bidc

Bidirectional Channels for JavaScript

by vercel
asyncchannelsiframejavascriptmessagingrpcworker
Star on GitHubForknpm

TypeScript

1.3k stars23 forks3 contributorsQuiet · 7mo agoSince 20250.0.4

Meet the team

See all 3 on GitHub →
shuding
shuding9 contributions
haingdc
haingdc1 contribution
Rich-Harris
Rich-Harris1 contribution

Languages

View on GitHub →
TypeScript99%
CSS0.8%
JavaScript0.2%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

1 of 6 standards met

Community profile →
37
✓README○License○Contributing○Code of Conduct○Issue Template○PR Template

Recent PRs & issues

Quiet · 1 in progress · Last activity 7mo ago
See all on GitHub →
kapeka0
fix: validate event.origin in handleConnect to prevent channel hijackingOpenPR

accepts any incoming message as long as the matches — it never checks where the message came from. Since the default is and any window with a handle to the target (opener, parent, named frame) can to it, a malicious window that knows or guesses the can complete the handshake and hijack a legitimate channel, intercepting all subsequent communication. A possible fix is to add an optional argument to . When provided: Inbound: connections whose differs from the declared origin are rejected in . Outbound: the origin is used as the for instead of , so handshake messages aren't broadcast to other origins. The expected origin has to be declared by the caller — it can't be derived from a cross-origin target ( throws a ), and deriving it from the first handshake (trust-on-first-use) is a race an attacker can win, so it wouldn't actually be safe. Fully backward compatible: without origin, behaviour is identical to before.

kapeka0 · 1mo ago
proudparrot2
Service worker support?OpenIssue

Can I use this to communicate with a service worker from the main thread? If so, how?

proudparrot2 · 10mo ago
weizman
Live client-side-only demo site (playground)OpenIssue

visit example.com, open devtools, paste and run - demo works Such an html file in the project, set up GitHub pages, and you get a playground for playing with this without having to load/install anything locally, could be useful

weizman · 1y ago

Recent fixes

View closed PRs →
shuding
chore: Add todosMergedPR
shuding · 7mo ago
shuding
chore: Upgrade devalue and remove patchMergedPR

It's upstreamed here: https://github.com/sveltejs/devalue/pull/123

shuding · 7mo ago
haingdc
fix a typoMergedPR

Hi, I see a tiny typo when I read code. It would be great if it could be corrected. Thank you

haingdc · 10mo ago
Structured data for AI agents

Repository: vercel/bidc. Description: Bidirectional Channels for JavaScript Stars: 1277, Forks: 23. Primary language: TypeScript. Languages: TypeScript (99%), CSS (0.8%), JavaScript (0.2%). Topics: async, channels, iframe, javascript, messaging, rpc, worker. Latest release: 0.0.4 (7mo ago). Open PRs: 1, open issues: 4. Last activity: 7mo ago. Community health: 37%. Top contributors: shuding, haingdc, Rich-Harris.

·@ofershap

Replace github.com with gitshow.dev