This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The onmessage property of the WindowEventHandlers is the EventHandler called whenever an object receives a message event. 


window.addEventListener('message', function(event) { ... })
window.onmessage = function(event) { ... }


Specification Status Comment
HTML Living Standard
The definition of 'onmessage' in that specification.
Living Standard Initial definition.

Browser Compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support60 ? ? ?47 ?
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support6060 ? ?47 ? ?

Document Tags and Contributors

Contributors to this page: fscholz, StripTM, jpmedley
Last updated by: fscholz,