DenoDDeno
Powered by
SnabelS
Denoβ€’4y agoβ€’
5 replies
Snabel

Monkey patch Broadcast Channel to send messages to current context

Essentially what I want to do is be able to connect to
new BroadcastChannel("test_channel");
new BroadcastChannel("test_channel");
which I in the same context want to post messages to and still be able to recieve them.

So if my pretty little drawing helps:
|---same javascript context----------|
| |-patched test_channel source----| |
| | Send messages here!            | |
| |--------------------------------| |
|                                    |
| |-test_channel-------------------| |
| | Recieve messages here          | |
| |--------------------------------| |
|                                    |
| |-test_channel-------------------| |
| | and here!                      | |
| |--------------------------------| |
|------------------------------------|
|---same javascript context----------|
| |-patched test_channel source----| |
| | Send messages here!            | |
| |--------------------------------| |
|                                    |
| |-test_channel-------------------| |
| | Recieve messages here          | |
| |--------------------------------| |
|                                    |
| |-test_channel-------------------| |
| | and here!                      | |
| |--------------------------------| |
|------------------------------------|
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

How to monkey patch an installed third party deno module.
1771771771177177177 / help
3y ago
deno kv watch vs broadcast channel
fro.profesionalFfro.profesional / help
3y ago
Most efficient way to broadcast messages globally across main script and workers?
jcayzacJjcayzac / help
3y ago