Web/API/WindowEventHandlers/onmessage

From Get docs

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


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

Syntax

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

Specifications

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

Browser compatibility

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
onmessage Chrome

Full support 60

Edge

Full support ≤79

Firefox

?

IE

?

Opera

Full support 47

Safari

?

WebView Android

Full support 60

Chrome Android

Full support 60

Firefox Android

?

Opera Android

Full support 44

Safari iOS

?

Samsung Internet Android

Full support 8.0

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown