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"); 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!                      | |
| |--------------------------------| |
|------------------------------------|
Was this page helpful?