# Using MessageChannel/BroadcastChannel from bootstrap.js

**URL:** <https://discourse.mozilla.org/t/using-messagechannel-broadcastchannel-from-bootstrap-js/8372>\
**Category:** Development\
**Created:** [April 28, 2016, 11:10am UTC](https://discourse.mozilla.org/t/using-messagechannel-broadcastchannel-from-bootstrap-js/8372 "2016-04-28T11:10:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![noitidart](https://avatars.discourse-cdn.com/v4/letter/n/9f8e36/32.png) [@noitidart](https://discourse.mozilla.org/u/noitidart)\
**Post date:** [April 28, 2016, 11:10am UTC](https://discourse.mozilla.org/t/using-messagechannel-broadcastchannel-from-bootstrap-js/8372/1 "2016-04-28T11:10:18Z")

</div>

Hi all,  
So I’m sending via transfer large ArrayBuffers from bootstrap to XUL windows with `window.postMessage`. I now need to get a modified ArrayBuffer back to bootstrap.js.

I read about the MessageChannel and BroadcastChannel API, and see that they are in the global window scope. They are not in the bootstrap.js scope. I was wondering if there was a way use these APIs from bootstrap?

The docs say it is availble in WebWorkers/ChromeWorkers, so if not possible to use from bootstrap.js I was thinking of: As I spawn the ChromeWorker from bootstrap.js, I can get a MessagePort to the worker and transfer the MessagePort to the windows, and have the ChromeWorker and windows talk directly (without bootstrap.js in the middle after the initial handshake).

Thanks
