Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2015.
Note: This feature is available in Web Workers.
The start() method of the MessagePort interface starts the sending of messages queued on the port. This method is only needed when using EventTarget.addEventListener; it is implied when using onmessage.
None.
None (undefined).
In the following code block, you can see a handleMessage handler function, run when a message is sent back to this document using onmessage:
Another option would be to do this using EventTarget.addEventListener, however, when this method is used, you need to explicitly call start() to begin the flow of messages to this document:
| HTML # dom-messageport-start-dev |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Sep 18, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.