• Web APIs
  • caches
  • credentialless Experimental
  • devicePixelRatio
  • documentPictureInPicture Experimental
  • event Deprecated
  • external Deprecated
  • fence Experimental
  • fullScreen Non-standard
  • innerWidth
  • launchQueue Experimental
  • locationbar
  • mozInnerScreenX Non-standard
  • mozInnerScreenY Non-standard
  • navigation Experimental
  • orientation Deprecated
  • originAgentCluster Experimental
  • performance
  • screenLeft
  • scrollbars
  • scrollMaxX Non-standard
  • scrollMaxY Non-standard
  • sessionStorage
  • sharedStorage Experimental
  • status Deprecated
  • trustedTypes
  • atob()
  • back() Non-standard Deprecated
  • blur() Deprecated
  • captureEvents() Deprecated
  • clearImmediate() Non-standard Deprecated
  • confirm()
  • dump() Non-standard
  • find() Non-standard
  • forward() Non-standard Deprecated
  • getDefaultComputedStyle() Non-standard
  • getScreenDetails() Experimental
  • moveTo()
  • prompt()
  • queryLocalFonts() Experimental
  • releaseEvents() Deprecated
  • requestFileSystem() Non-standard Deprecated
  • scroll()
  • scrollByLines() Non-standard
  • scrollByPages() Non-standard
  • setImmediate() Non-standard Deprecated
  • setResizable() Non-standard Deprecated
  • showDirectoryPicker() Experimental
  • showModalDialog() Non-standard Deprecated
  • showOpenFilePicker() Experimental
  • showSaveFilePicker() Experimental
  • sizeToContent() Non-standard
  • webkitConvertPointFromNodeToPage() Non-standard Deprecated
  • webkitConvertPointFromPageToNode() Non-standard Deprecated
  • Events
    1. beforeprint
    2. cut
    3. error
    4. hashchange
    5. messageerror
    6. orientationchange Deprecated
    7. pageswap
    8. resize
    9. scrollsnapchange Experimental
    10. scrollsnapchanging Experimental
    11. unload Deprecated
    12. vrdisplayactivate Non-standard Deprecated
    13. vrdisplayconnect Non-standard Deprecated
    14. vrdisplaydeactivate Non-standard Deprecated
    15. vrdisplaydisconnect Non-standard Deprecated
    16. vrdisplaypresentchange Non-standard Deprecated
  • Inheritance
    1. Window object when it receives a message that can't be deserialized.

      This event is not cancellable and does not bubble.

  • Syntax

    Use the event name in methods like addEventListener(), or set an event handler property.

    js
    addEventListener("messageerror", (event) => {});
    
    onmessageerror = (event) => {};
    

    Event type

    Event properties

    This interface also inherits properties from its parent, Event.

    MessageEvent.data Read only

    The data sent by the message emitter.

    MessageEvent.origin Read only

    A string representing the origin of the message emitter.

    MessageEvent.lastEventId Read only

    A string representing a unique ID for the event.

    MessageEvent.source Read only

    A MessageEventSource (which can be a ServiceWorker object) representing the message emitter.

    MessageEvent.ports Read only

    An array of MessagePort objects representing the ports associated with the channel the message is being sent through (where appropriate, e.g. in channel messaging or when sending a message to a shared worker).

    Examples

    Listen for messageerror using addEventListener():

    js
    window.addEventListener("messageerror", (event) => {
      console.error(event);
    });
    

    The same, but using the onmessageerror event handler property:

    js
    window.onmessageerror = (event) => {
      console.error(event);
    };
    

    Specifications

    Specification
    HTML
    # handler-window-onmessageerror

    Browser compatibility

    BCD tables only load in the browser

    See also